Skip to content

Instantly share code, notes, and snippets.

{
"type" : "record",
"name" : "geolocation",
"namespace" : "svds.trains",
"fields" : [ {
"name" : "type",
"type" : [ "null", "string" ],
"default" : null
}, {
"name" : "coordinates",
@RyanMagnusson
RyanMagnusson / 0_reuse_code.js
Last active August 29, 2015 14:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@RyanMagnusson
RyanMagnusson / osx-for-hackers.sh
Last active August 29, 2015 14:28 — forked from matthewmueller/osx-for-hackers.sh
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@RyanMagnusson
RyanMagnusson / git-log-to-tsv.sh
Last active November 18, 2015 17:59 — forked from pwenzel/git-log-to-tsv.sh
Git Log to Tab-Delimited CSV File
# Local Dates:
git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt
# ISO Dates:
git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt

Keybase proof

I hereby claim:

  • I am ryanmagnusson on github.
  • I am ryanmagnusson (https://keybase.io/ryanmagnusson) on keybase.
  • I have a public key whose fingerprint is 4671 A7D5 B167 918E 426B D68D 8126 4927 6806 C99B

To claim this, I am signing this object:

@RyanMagnusson
RyanMagnusson / brew-instructions.sh
Created November 9, 2017 22:56 — forked from petemcw/brew-instructions.sh
Setup dnsmasq on Mac OS X
# Install `dnsmasq` and configure for *.dev domains
$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf
# Reload configuration and clear cache
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ dscacheutil -flushcache
@RyanMagnusson
RyanMagnusson / dnsmasq OS X.md
Created November 9, 2017 22:57 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.

Requirements

Install

@RyanMagnusson
RyanMagnusson / dnsmasq.md
Created November 9, 2017 22:57 — forked from tmslnz/dnsmasq.md
Setting up dnsmasq on OS X

Install dnsmasq

Via brew or other method

Set up DNS resolver order

In order to work on every connection and on any TLD, dnsmasq needs to be the first DNS resolver receving the query.

And since dnsmasq is a local process, all DNS queries need to go to 127.0.0.1

On macOS, /etc/resolv.conf is automaticaly created, depending on a variety of things (network settings, etc), so it cannot be edited.

from typing import Union, Optional, List, Dict, Set
from enum import Enum
from os import walk
from os.path import realpath, join, isfile, isdir, basename, getsize
from hashlib import md5,sha256
from argparse import ArgumentParser
from json import loads as unpickle, dumps as pickle
import sys
#!/usr/bin/python
# As written, this requires the following:
# - OS X 10.6+ (may not work in 10.10, haven't tested)
# - python 2.6 or 2.7 (for collections.namedtuple usage, should be fine as default python in 10.6 is 2.6)
# - pyObjC (as such, recommended to be used with native OS X python install)
# Only tested and confirmed to work against 10.9.5
# Run with root