Skip to content

Instantly share code, notes, and snippets.

Amit Upadhyay amitu

Block or report user

Report or block amitu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ruby-allocator-count.py
#!/usr/bin/python
# to try this you'll need to edit in the name of your ruby binary and install bcc-tools
# bcc installation instructions are at https://github.com/iovisor/bcc/blob/master/INSTALL.md
from __future__ import print_function
from bcc import BPF
from time import sleep
import os
# load BPF program
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

@SethCalkins
SethCalkins / LittleSnitch_Block_List.md
Last active Aug 8, 2019
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.

@chalmagean
chalmagean / onSelect.elm
Last active Dec 22, 2016
Elm onSelect decoder
View onSelect.elm
-- Assuming we have a list of items in the model (type alias Model = { items : List Item }
-- where Item is a record like { id : Int, name : String }
-- this goes in the view and generates an html dropdown
select
[ onSelect ValueSelectedMsg ]
(List.map (\item -> option [ value (toString item.id) ] [ text item.name ]) model.items)
targetSelectedIndex : Json.Decoder Int
@androidfred
androidfred / haskell_stack_and_intellij_idea_ide_setup_tutorial_how_to_get_started.md
Last active Jul 24, 2019
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 Apr 24, 2019
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.

@chrisclark
chrisclark / pypi-release-checklist.md
Last active Apr 3, 2018 — forked from audreyr/pypi-release-checklist.md
SQL Explorer Release Checklist
View pypi-release-checklist.md
  • Update HISTORY
  • Update README and check formatting with http://rst.ninjs.org/
  • Make sure any new files are included in MANIFEST.in
  • Update version number in explorer/__init__.py
  • Update any package dependencies in setup.py
  • Commit the changes:
git add .
git commit -m "Release 1.0.0"
View httpclient.go
package httptimeout
import (
"net/http"
"time"
"fmt"
)
type TimeoutTransport struct {
http.Transport
@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')
View inline-css-font.rb
#!/usr/bin/env ruby
require 'base64'
require 'open-uri'
# file or url
def get_css(src)
if src.start_with? 'http'
src = src.gsub('|', '%7C')
STDERR.puts "# GET #{src}"
# simulate modern browser to get woff
You can’t perform that action at this time.