Skip to content

Instantly share code, notes, and snippets.

@codler
codler / GIT.md
Last active December 9, 2021 20:52
Useful GIT commands

Setup

git config --global user.name "XXX"		# Full name
git config --global user.email "XXX"	# Email
git config --global github.user XXX		# Username
git config --global github.token XXX	# Token

New rep

/**
* Register ajax transports for blob send/recieve and array buffer send/receive via XMLHttpRequest Level 2
* within the comfortable framework of the jquery ajax request, with full support for promises.
*
* Notice the +* in the dataType string? The + indicates we want this transport to be prepended to the list
* of potential transports (so it gets first dibs if the request passes the conditions within to provide the
* ajax transport, preventing the standard transport from hogging the request), and the * indicates that
* potentially any request with any dataType might want to use the transports provided herein.
*
* Remember to specify 'processData:false' in the ajax options when attempting to send a blob or arraybuffer -

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
http://pastie.org/2054699
@codler
codler / gist:5862854
Created June 25, 2013 22:00
Sort version
['1.0.zip', '1.1.1.zip', '1.1.zip', '1.2.zip'].sort(function(a, b) { console.log('-');console.log(a);console.log(b); return (a.replace('.zip', '') < b.replace('.zip', '')) ? -1 : (a.replace('.zip', '') > b.replace('.zip', '')) ? 1 : 0 })
package com.ab.jersey.dto;
public class AppError {
private String message;
public AppError() { }
public AppError(String message) {
this.message = message;
}
@codler
codler / gist:5383971
Created April 14, 2013 19:56
IRC bot, Node.js v0.6, 2011-12-15 Read and write to both irc and file. Two-way communication.
var util = require('util'),
net = require('net');
fs = require('fs');
vm = require('vm');
repl = require('repl');
var socket = new net.Socket();
socket.setNoDelay(true);
socket.setEncoding('ascii');
@codler
codler / dabblet.css
Created March 26, 2013 08:27
Loading Spinner in CSS
@keyframes wheel {
to { transform:rotate(360deg); }
}
.circularProgress:before {
content: '';
display: inline-block;
width: 50px;
height: 50px;
background:
linear-gradient(0deg, transparent 49%, white 49%, white 51%, transparent 51%) 0 0px,
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
namespace HumanResourcesLib
{
class DelegateCommand : ICommand
{
@codler
codler / gist:4715753
Created February 5, 2013 16:51
Miniräknare, actionscript 2, 2007-03-30
//********************************
// Made by Han Lin Yap
// Copyright Codler
//********************************
stop();
var knapp = new Array();// Kommer att innehålla knapparna.
var m_mall = new Array();// Knappens bakgrund
var knappens_text = new Array(); // Knappens text
/* Start av konfiguering */