Skip to content

Instantly share code, notes, and snippets.

@mjangda
mjangda / console-error.js
Created April 29, 2010 19:37
Protects you from console.log() errors for your IE and Firebug-less Firefox users.
// In case we forget to take out console statements. IE becomes very unhappy when we forget. Let's not make IE unhappy
if(typeof(console) === 'undefined') {
var console = {}
console.log = console.error = console.info = console.debug = console.warn = console.trace = console.dir = console.dirxml = console.group = console.groupEnd = console.time = console.timeEnd = console.assert = console.profile = function() {};
}

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@zliang-min
zliang-min / example.rb
Created November 10, 2011 18:30
You don't need a library for everything. For example, git.io :)
Git.io.generate 'https://gist.github.com/gists/1355677'
Git.io.generate 'https://github.com/gimi', 'gimi'
Git.io.recognize 'http://git.io/gimi'

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

anonymous
anonymous / Default.aspx.cs
Created August 7, 2012 10:05
// Get image from Base64 string
string sData =
"iVBORw0KGgoAAAANSUhEUgAAAeAAAADXCAYAAADC3II0AAAABHNCSVQICAgIfAhkiAAACN1JREFUeJzt3dtym0oQQFGUyv//ss5Dyj7yRQLEQHdPr1WVt8TB1sD2zIB0u9/v9wUAuNSf6AMAgI4EGAACCDAABBBgAAggwAAQQIABIIAAA0AAAQaAAAIMAAEEGAACCDAABBBgAAggwAAQQIABIIAAA0CAv9EHAMD/brfbW//OR7vXI8AACbwbXuoSYIAgI6N7u93MgosRYIALnTnTFeFa3IQFcIHb7XbJMrOl7DrMgAFOcvYNVc++vplwDQIMMNhVdzLf73cz3sJud78mARwW+fjQs//b5T03AQZ4U6ZndkW4HkvQADtlCu8a+8F5mQGT3veLnSFLhArRfXWMzpt8BJiUtlzsDF2uUCG8j0S4DkvQpLH3QmdpjbNUi+73Y3BndA1mwIQbcbEwjDmqcnR/46as/MyACTH6N/SPr+fiwl6zhXeNlaM8zIC5zJHofgxTe8OM0CW69oNzE2BONSK6735NQ5vvuoT3kQjnJcCc4ooLnRCzRcfofmc/OCd7wAxz9YVu67K0Pa9+RJcKBJhDzlhifufrbInwyP+TnIT3J48k5WUJmt0yRPcZN2n1I7rP2f/NTYDZrNKFTojnV2k8RhDf/ASYVe9c6DIMKzdpzUd0txHfGuwB89LeC16mk9tNWnMQ3XH8THIxA+apmWaQM30vXQjvezxyVIcA86u1i1/VYSPE+VXd8shAfGuxBM0PM+8fWZbOyWz3OI8b1SPAbDbTxc6zwzmY7Y4x8y/NM7MEzRcdl7A8snS9yjf3ZSO+dQkwnzrG94O94WsI71jiW5slaJZlsX+0Z2/48e+zjfCOJ771CTAvdTuR3aQ1juieR3znYAma1kvPr1iWfo/wnkt85yHAzYnvOjdpbSO85xP
private Image byteArrayToImage(byte[] byteArrayIn)
{
MemoryStream ms = new MemoryStream(byteArrayIn);
Image returnImage = Image.FromStream(ms);
return returnImage;
}
anonymous
anonymous / WebHelper.cs
Created August 8, 2012 03:36
public static string GetSignatureImageUrl(object transactionId)
{
return string.Format("{0}/{1}/signature-{2}.png",
HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + HttpContext.Current.Request.ApplicationPath,
ConfigurationManager.AppSettings["ImagesFolder"],
transactionId);
}
@tekener
tekener / pom.xml
Created September 11, 2012 17:10
Ensure that Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files are installed using maven-enforcer-plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>enforce</id>
<configuration>
<rules>
@caleb-vear
caleb-vear / ContinueAfter.cs
Created October 9, 2012 01:19
Continue After implementation
public static IObservable<TRet> ContinueAfter<T, TRet>(this IObservable<T> observable, Func<IObservable<TRet>> selector)
{
return observable
.Materialize()
.Where(n => n.Kind == NotificationKind.OnCompleted)
.SelectMany(_ => selector());
}