This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.Linq; | |
using System.Web; | |
using Dapper; | |
using Glimpse.Core.Extensibility; | |
using MySite.WebGUI.Areas.Admin.Controllers; | |
using MvcMiniProfiler.Data; | |
using MySql.Data.MySqlClient; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SqlServerStorage.cs | |
// ... | |
if (t.HasChildren) // line 187 of the original file | |
{ | |
foreach (var child in t.Children) | |
{ | |
SaveTiming(conn, profiler, child); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" automatic installation | |
if empty(glob('~/.vim/autoload/plug.vim')) | |
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs | |
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
autocmd VimEnter * PlugInstall | source $MYVIMRC | |
endif | |
call plug#begin('~/.vim/plugged') | |
" Colorschemes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:var c=[{r:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,p:function(b){return[parseInt(b[1]),parseInt(b[2]),parseInt(b[3])]}},{r:/^(\w{2})(\w{2})(\w{2})$/,p:function(b){return[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16)]}},{r:/^(\w{1})(\w{1})(\w{1})$/,p:function(b){return[parseInt(b[1]+b[1],16),parseInt(b[2]+b[2],16),parseInt(b[3]+b[3],16)]}}];function w(b){this.ok=!1;"#"==b.charAt(0)&&(b=b.substr(1,6));b=b.replace(/ /g,"").toLowerCase();for(a=0;a<c.length;a++){var d=c[a].r.exec(b);d&&(z=c[a].p(d),this.r=z[0],this.g=z[1],this.b=z[2],this.ok=!0)}this.r=0>this.r||isNaN(this.r)?0:255<this.r?255:this.r;this.g=0>this.g||isNaN(this.g)?0:255<this.g?255:this.g;this.b=0>this.b||isNaN(this.b)?0:255<this.b?255:this.b}function y(){var b=["color","background-color"];$($("*").get().reverse()).each(function(){var d=null,e;for(e in b)e=b[e],$(this).css(e)&&(d=new w($(this).css(e)),d.ok&&$(this).css(e,"rgb("+(255-d.r)+","+(255-d.g)+","+(255-d.b)+")"))})}function z(b,d){var e=document.createElement("script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git tfs quick-clone -d http://tfs-server-name:tfs-server-port/tfs/name $/project/info C:/where/to/put/it | |
http://stackoverflow.com/a/7532131/435460 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ClassWithListView { | |
/** | |
* The last index in the list that the user was at. | |
*/ | |
private int lastIndex = -1; | |
/** | |
* Used with lastIndex to match the exact offset. | |
*/ | |
private int lastIndexOffset = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Singleton | |
{ | |
private static readonly Lazy<Singleton> _lazy = new Lazy<Singleton>( | |
() => new Singleton(), LazyThreadSafetyMode.ExecutionAndPublication); | |
public static Singleton Instance | |
{ | |
get | |
{ | |
return Singleton._lazy.Value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct Id | |
{ | |
private long _id; | |
public Id(long id) | |
{ | |
this._id = id; | |
} | |
public static implicit operator Id(long value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
virtualenv --distribute --no-site-packages %1 | |
python update-mingw-compiler.py %1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pprint_defaultdict(): | |
from collections import defaultdict | |
import IPython | |
ip = get_ipython() | |
tf = ip.display_formatter.formatters['text/plain'] | |
def _print_default_dict(arg, p, cycle): | |
""" Pretty print a defaultdict. """ | |
def rec(obj, indent=0, level=0): | |
if isinstance(obj, defaultdict) or isinstance(obj, dict): | |
p.text('{\n') |
OlderNewer