Skip to content

Instantly share code, notes, and snippets.


Amit Upadhyay amitu

View GitHub Profile
ghoseb / tetris.clj
Created Sep 12, 2011 — forked from alexander-yakushev/tetris.clj
Tetris implementation in Clojure
View tetris.clj
(ns tetris.core
(:import (java.awt Color Dimension BorderLayout)
(javax.swing JPanel JFrame JOptionPane JButton JLabel)
(java.awt.event KeyListener))
(:use clojure.contrib.import-static deflayout.core
(import-static java.awt.event.KeyEvent VK_LEFT VK_RIGHT VK_DOWN VK_UP VK_SPACE)
mrdoob / gist:3504382
Created Aug 28, 2012
Encoding png sequence + audio into a webm with good quality.
View gist:3504382
ffmpeg -r 24 -i sequence/%d.png -i audio.aif -g 120 -level 216 -profile 0 -qmax 42 -qmin 10 -rc_buf_aggressivity 0.95 -vb 2M video.webm
simonw / gist:3947083
Created Oct 24, 2012
Setting up port forwarding from inside an SSH session
View gist:3947083
localhost:~$ ssh$
... ooh, I could really do with a port forwarding to something on here ...
Secret SSH shell!
ssh> -L8080:localhost:8080
kingel / php.cfg
Created Oct 29, 2012
View php.cfg
# ===================================================================
# Builds PHP as an Apache module (Apache profile needed)
extends =
# Buildout parts
parts +=
dcramer /
Last active Dec 11, 2015
Because you should maintain API compatibility when you tell everyone to use your shit.
from requests.models import Response
class fixedjson(object):
def __init__(self, func):
self.func = func
def __get__(self, inst, cls):
result = self.func(inst)
class proxy(type(result)):
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
[ onSelect ValueSelectedMsg ]
( (\item -> option [ value (toString ] [ text ]) model.items)
targetSelectedIndex : Json.Decoder Int
# to try this you'll need to edit in the name of your ruby binary and install bcc-tools
# bcc installation instructions are at
from __future__ import print_function
from bcc import BPF
from time import sleep
import os
# load BPF program
  • Update HISTORY
  • Update README and check formatting with
  • Make sure any new files are included in
  • Update version number in explorer/
  • Update any package dependencies in
  • Commit the changes:
git add .
git commit -m "Release 1.0.0"
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
kogakure /
Created Oct 17, 2009
Python: Fabric 0.9/1.x - Synchronize files with rsync
# -*- coding: utf-8 -*-
# Fabric 0.9/1.x – Synchronize files in a project folder with webserver
from fabric.api import env
from fabric.contrib.project import rsync_project
env.hosts = ['']
env.path = '/home/user/project/'