Skip to content

Instantly share code, notes, and snippets.

// Struct Store
//
// Version 1: We may have written...
DocumentDatabase db = new DocumentDatabase();
User user = new User();
user.Id = 123;
user.FirstName = ....;
user.LastName = ....;
user.Bio = ....;
@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());
}
@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>
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);
}
private Image byteArrayToImage(byte[] byteArrayIn)
{
MemoryStream ms = new MemoryStream(byteArrayIn);
Image returnImage = Image.FromStream(ms);
return returnImage;
}
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
@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

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@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'

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