Skip to content

Instantly share code, notes, and snippets.


Nathan Phillip Brink binki

View GitHub Profile
CollinChaffin /
Created Aug 29, 2018
How to disable the very little-known AT&T setting that can appear to hijack your home DNS lookups and redirect to

How to disable the very little-known AT&T setting that can appear to hijack your home DNS lookups and redirect to


DNS queries on home network suddenly resolving hosts to


You will see SPORADIC mis-resolutions of EVERYTHING to that address if their crappy router happens to hear your PC's DHCP request - EVEN IF ANOTHER DHCP SERVER ON THE NETWORK assigns the ultimate address.

binki / code.csx
Created Jul 6, 2018
Type.IsAssignableFrom Truth Table
View code.csx
Console.WriteLine("| `left` | `right` | `left.IsAssignableFrom(right)` |");
Console.WriteLine("| --- | --- | --- |");
var types = new[] {
foreach (var left in types) {
foreach (var right in types) {
Console.WriteLine($"| {left} | {right} | {left.IsAssignableFrom(right)} |");
ljw1004 / tuple_perf.cs
Created Apr 20, 2017
Perf comparison ValueTuple vs Tuple vs KeyValuePair
View tuple_perf.cs
// Tuples are generally fastest.
// ValueTuple is fastest in the particular case of GetHashCode.
// KeyValuePair is always worst.
// Numbers in milliseconds (lower is better)
binki / Program.cs
Last active Jan 18, 2017
Play with C# string interpolation
View Program.cs
using System;
namespace FormattablePlay
class Program
static void Main(string[] args)
var stringVar = "plant";
Append($"SELECT * FROM blah b WHERE b.Thing = {stringVar}");
danverbraganza /
Last active Apr 20, 2017
Hangman implemented in 3 lines of Python! For an explanation of how this works, see
license, chosen_word, guesses, scaffold, man, guesses_left = '', ''.join(filter(str.isalpha, __import__('random').choice(open('/usr/share/dict/words').readlines()).upper())), set(), '|======\n| |\n| {3} {0} {5}\n| {2}{1}{4}\n| {6} {7}\n| {8} {9}\n|', list('OT-\\-//\\||'), 10
while not all(letter in guesses for letter in chosen_word) and guesses_left: _, guesses_left = map(guesses.add, filter(str.isalpha, raw_input('%s(%s guesses left)\n%s\n%s:' % (','.join(sorted(guesses)), guesses_left, scaffold.format(*(man[:10-guesses_left] + [' '] * guesses_left)), ' '.join(letter if letter in guesses else '_' for letter in chosen_word))).upper())), max((10 - len(guesses - set(chosen_word))), 0)
print 'You', ['lose!\n' + scaffold.format(*man), 'win!'][bool(guesses_left)], '\nWord was', chosen_word
elsassph / 1-loop-es6.js
Last active Dec 5, 2016
ES2015 / babel vs Haxe code generation
View 1-loop-es6.js
const a = [1,2,3];
var acc = 0;
for (const v of a) {
acc += v;
// want clean code? use Array.reduce
luislavena /
Last active Jan 18, 2021
Workaround RubyGems' SSL errors on Ruby for Windows (RubyInstaller)

SSL upgrades on and RubyInstaller versions

UPDATE 2016-12-01: Please refer to the official guide instead of this process.

UPDATE 2014-12-21: RubyGems 1.8.30, 2.0.15 and 2.2.3 have been released. It requires manual installation, please see instructions below.


ungoldman /
Last active Feb 26, 2021
post a JSON file with curl

How do you POST a JSON file with curl??

You can post a json file with curl like so:

curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION

so for example:

jammycakes / LazyDisposable.cs
Last active Jun 19, 2019
A subclass of System.Lazy<T> that implements IDisposable and forwards calls to the Dispose method on to the lazily created instance if it exists.
View LazyDisposable.cs
/// <summary>
/// A <see cref="Lazy"/> object that implements <see cref="IDisposable"/>.
/// </summary>
/// <typeparam name="T">
/// The object being lazily created.
/// </typeparam>
public class LazyDisposable<T> : Lazy<T>, IDisposable where T: IDisposable
/// <summary>