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
✔ ~/.vim/bundle | |
$ for d in *; do pushd $d >/dev/null; git remote show -n origin | awk '/Fetch/{ print $3 }'; popd>/dev/null; done | |
https://github.com/mattn/emmet-vim.git | |
https://github.com/KabbAmine/gulp-vim.git | |
https://github.com/phildawes/racer.git | |
https://github.com/rust-lang/rust.vim.git | |
https://github.com/scrooloose/syntastic.git | |
https://github.com/leafgarland/typescript-vim.git | |
https://github.com/bling/vim-airline | |
git://github.com/altercation/vim-colors-solarized.git |
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
#!/bin/sh | |
# Usage ./rfkill-toggle.sh [IDENTIFIER] | |
# where IDENTIFIER is the index no. of an rfkill switch or one of: | |
# wifi wlan bluetooth uwb ultrawideband wimax wwan gps fm nfc | |
ID=`rfkill list "$1" | head -c 1 | cut -f 1` | |
SOFT="/sys/class/rfkill/rfkill$ID/soft" | |
if [ ! -f "$SOFT" ]; then |
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
/// <summary> | |
/// Safe helper to defer setup until needed and teardown until after a delay | |
/// </summary> | |
/// <remarks> | |
/// You're on your own if setup or teardown throws or if Dispose is not called on each Acquire result | |
/// </remarks> | |
public class DelayedTeardown | |
{ | |
// -1 indicates that setup needs to be run | |
private int _count = -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
public sealed class NestedStopwatch | |
{ | |
public struct Split : IDisposable | |
{ | |
private NestedStopwatch _parent; | |
private int _index; | |
internal Split(NestedStopwatch sw, int index) | |
{ | |
_parent = sw; |
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 static class SlowCloner | |
{ | |
public static T Clone<T>(T val, int depth = 64) | |
{ | |
return (T)CloneNonGeneric(val, typeof(T), depth); | |
} | |
static object CloneNonGeneric(object val, Type type, int depth = 64) | |
{ | |
if (val == null) return null; |
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
// find the needle that exactly matches the specified portion of haystack | |
// will return -1 for count of 0 | |
public static int NeedleIndex(byte[] haystack, int offset, int count, byte[][] needles) | |
{ | |
Debug.Assert(needles.Length <= 8, "Can only search for up to 8 needles at once"); | |
ulong mask = 0; | |
for (int i = 0; i < needles.Length; i++) | |
{ | |
if (needles[i] != null && needles[i].Length == count) |
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 static class Template | |
{ | |
public struct Span<T> | |
{ | |
/// <summary>If Literal is not null it should be used and Variable should be ignored</summary> | |
public readonly string Literal; | |
/// <summary>Variable should only be used if Literal is null</summary> | |
public readonly T Variable; | |
public Span(string literal, T 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
var UglifyJS = require("uglify-js"); | |
var fs = require('fs'); | |
var defineName = 'define', | |
getTextModule = 'shared/gettext', | |
currentGetTextName, | |
stringDefinitions, | |
placeholders, | |
stringKeys, | |
moduleName; |
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 unsafe static class FieldPointer | |
{ | |
public delegate void Get<TItem, TPtr>(ref TItem item, out TPtr* ptr) | |
where TItem : struct; | |
public static Get<TItem, TPtr> Generate<TItem, TPtr>(FieldInfo field) | |
where TItem : struct | |
{ | |
var fixedElementField = field.FieldType.GetField("FixedElementField"); | |
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
/// <summary> | |
/// High speed TextReader-like object, wraps a byte array directly rather than a Stream | |
/// Almost 3x faster than StreamReader + MemoryStream in my tests | |
/// </summary> | |
public struct QuickAsciiReader | |
{ | |
private readonly byte[] _Array; | |
private int _Index; | |
private readonly int _End; | |