Skip to content

Instantly share code, notes, and snippets.


Amit Upadhyay amitu

View GitHub Profile
View httpclient.go
package httptimeout
import (
type TimeoutTransport struct {
thomasballinger /
Created Dec 15, 2013
Using a pseudo-terminal to interact with interactive Python in a subprocess
from subprocess import Popen, PIPE
import pty
import os
from select import select
import sys
import tty
master, slave = pty.openpty()
p = Popen(['python'], stdin=slave, stdout=PIPE, stderr=PIPE)
pin = os.fdopen(master, 'w')

A Beginner's Hip Hop Playlist

Edit: After some constructive feedback on hacker news, I think that it's worth mentioning that this playlist is very skewed towards recent material, although I've included some essentials from the past.

I think that hip hop is one of the most, if not the most, misunderstood genres of music. In this playlist, rather than focusing on one artist or one type of hip hop, I tried to give examples of a bunch of different artists with songs ranging from the early 90's all the way up until 2017. The songs are in no particular order and the sounds cover a very broad spectrum. Some of them are pretty damn explicit, so I wouldn't necessarily throw this playlist on if there are kids around. I provided the lyrics to each song, the sub-genre that I'd put the artist in (very rough), and a brief description. This playlist is not by any means meant to be comprehensive and in many cases doesn't necessarily represent the artist's "best" song, but instead aims at exposing you to some of my fa

pklaus /
Created Jun 16, 2011
How to access the Mac OS X Address Book from Python: <>
import objc
import AddressBook as ab
import pprint as pp
def pythonize(objc_obj):
if isinstance(objc_obj, objc.pyobjc_unicode):
return unicode(objc_obj)
elif isinstance(objc_obj, ab.NSDate):
return objc_obj.description()
xypnox / deep
Created Sep 4, 2019
Deep Work - Notes
View deep

Deep Work

Cal Newport

These notes are specific to me, I have cherry picked the points that I find most important. Thus, it is an incomplete summary of Deep work. It is however, thorough enough for me. I would suggest reading the book and making your own notes before going through mine.

Deep Work: Professional activities performed in a state of distraction-free concentration that push your cognitive capabilities to their limit. These efforts create new value, improve your skill, and are hard to replicate.

SethCalkins /
Last active Nov 29, 2020
Little Snitch Script to block Ad Servers

Here is a script to take the hosts from From and convert them to rules for Little Snitch.

It has options to grab the entire list or grab new entries past a certain date.

Just grab the output and copy/paste into Little Snitch.

The script is written to block access to any process, any port. You can also delete those lines and it will only block Mail. Or use the options to enter any process, port or protocol you want to block.

haasn /
Last active Dec 29, 2020
Firefox bullshit removal via about:config

Firefox bullshit removal

Updated: Just use qutebrowser (and disable javascript). The web is done for.

androidfred /
Last active Dec 31, 2020
Haskell, Stack and Intellij IDEA IDE setup tutorial how to get started

Haskell, Stack and Intellij IDEA IDE setup tutorial how to get started

Upon completion you will have a sane, productive Haskell environment adhering to best practices.


  • Haskell is a programming language.
  • Stack is tool for Haskell projects. (similar tools for other languages include Maven, Gradle, npm, RubyGems etc)
  • Intellij IDEA IDE is a popular IDE.

Install required libraries

sudo apt-get install libtinfo-dev libghc-zlib-dev libghc-zlib-bindings-dev

View gist:2597326

Moving from jQuery


// jQuery
$(document).ready(function() {
  // code
artisonian / .gitignore
Last active Jan 8, 2021
View .gitignore
You can’t perform that action at this time.