Skip to content

Instantly share code, notes, and snippets.

Avatar

Amit Upadhyay amitu

View GitHub Profile
@willurd
willurd / web-servers.md
Last active Nov 25, 2020
Big list of http static server one-liners
View web-servers.md

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@SethCalkins
SethCalkins / LittleSnitch_Block_List.md
Last active Nov 13, 2020
Little Snitch Script to block Ad Servers
View LittleSnitch_Block_List.md

Here is a script to take the hosts from From http://pgl.yoyo.org/adservers/ 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.

@xypnox
xypnox / deep work.md
Created Sep 4, 2019
Deep Work - Notes
View deep work.md

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.

@androidfred
androidfred / haskell_stack_and_intellij_idea_ide_setup_tutorial_how_to_get_started.md
Last active Oct 23, 2020
Haskell, Stack and Intellij IDEA IDE setup tutorial how to get started
View haskell_stack_and_intellij_idea_ide_setup_tutorial_how_to_get_started.md

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.

Basics

  • 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

@haasn
haasn / about:config.md
Last active Oct 5, 2020
Firefox bullshit removal via about:config
View about:config.md

Firefox bullshit removal

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

View gist:2597326

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@pklaus
pklaus / print_contacts_from_address-book.py
Created Jun 16, 2011
How to access the Mac OS X Address Book from Python: <http://www.programmish.com/?p=26>
View print_contacts_from_address-book.py
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()
View beginners_rap_playlist.md

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

@thomasballinger
thomasballinger / subprocess.py
Created Dec 15, 2013
Using a pseudo-terminal to interact with interactive Python in a subprocess
View subprocess.py
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')
@artisonian
artisonian / .gitignore
Last active May 17, 2020
go-eventsource
View .gitignore
eventsource
go-eventsource
client/client
You can’t perform that action at this time.