Skip to content

Instantly share code, notes, and snippets.

@natesilva
natesilva / gist:11409605
Last active August 29, 2015 14:00
Use Google DNS servers on a Linode Ubuntu instance

As a temporary workaround for Linode DNS problems, make your servers resolve using Google DNS. You must list Google’s DNS servers before Linode’s.

One way to do this in Ubuntu Linux is:

  1. Add the following line to /etc/dhcp/dhclient.conf:

    prepend domain-name-servers 8.8.8.8, 8.8.4.4;

  2. Reboot, or restart networking: sudo /etc/init.d/networking restart

# Example showing how a subtlety in the way Python handles default
# arguments can cause a bug.
class C(object):
def __init__(self, list1=[], list2=None):
# Wrong: if the list1 default argument of [] is used, that
# default will be *shared* among all instances of the class.
# If it is later modified, other instances can unexpectedly
# inherit the modifications.
self.list1 = list1
# Example showing how Python default argument handling causes a bug
# when using the ReportLab library for Python. Tested against
# ReportLab 2.3.
#
# See http://gist.github.com/246507 for a generic Python example.
from reportlab.platypus import *
def main():
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' WinUnit - Maria Blees (maria.blees@microsoft.com)
'
' [ With modifications by Nate Silva to fix "Current function is not a WinUnit
' test (BEGIN_TEST)" - see http://goo.gl/Znfb ]
'
' This module contains macros for running tests.
'
' In order to use these, make sure that the variable
' WinUnitPath in the _Variables module is set to where
@natesilva
natesilva / gist:783687
Created January 17, 2011 23:20
Find command shown as Stack Overflow answer doesn’t work
### See http://j.mp/ffN320
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.10
DISTRIB_CODENAME=karmic
DISTRIB_DESCRIPTION="Ubuntu 9.10"
$ mkdir mydir
$ cd mydir
$ touch test.h test.cpp
@natesilva
natesilva / init.js
Created September 10, 2012 18:18
Chocolat mixin onUnload does not fire when window is closed using the red "X"
//
// To test:
//
// (Use this in a Chocolat Mixin. Drop in any default.html file.)
//
// 1. Press Cmd-Opt-Ctrl-H and note the window appears.
// 2. Press "OK" and note that onUnload fires.
// 3. Repeat several times until you're convinced it works.
//
// Then:
@natesilva
natesilva / crashlog-build-112.txt
Created June 25, 2018 16:27
TablePlus crash log for build 112
Process: TablePlus [2183]
Path: /private/var/folders/*/TablePlus.app/Contents/MacOS/TablePlus
Identifier: com.tinyapp.TablePlus
Version: 1.0 (112)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: TablePlus [2183]
User ID: 501
Date/Time: 2018-06-25 09:18:35.223 -0700
@natesilva
natesilva / crashlog-dropbox-build.txt
Created June 25, 2018 16:27
TablePlus crash log for Dropbox build
Process: TablePlus [2231]
Path: /private/var/folders/*/TablePlus.app/Contents/MacOS/TablePlus
Identifier: com.tinyapp.TablePlus
Version: 1.0 (112)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: TablePlus [2231]
User ID: 501
Date/Time: 2018-06-25 09:19:37.801 -0700
Process: TablePlus [9719]
Path: /Users/USER/*/TablePlus.app/Contents/MacOS/TablePlus
Identifier: com.tinyapp.TablePlus
Version: 1.0 (112)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: TablePlus [9719]
User ID: 502
Date/Time: 2018-06-25 12:38:57.600 -0700
@natesilva
natesilva / IMG_A3946B9F870B-1.jpeg
Last active September 9, 2018 19:03
Open Radar (Apple Bug Report) #44281430: Siri returns results for the wrong sports team (Oregon Ducks)
IMG_A3946B9F870B-1.jpeg