Skip to content

Instantly share code, notes, and snippets.

View omaraboumrad's full-sized avatar

Omar Abou Mrad omaraboumrad

View GitHub Profile
@omaraboumrad
omaraboumrad / fiddle.css
Last active December 25, 2015 23:29
space shooter
p{
font-family: verdana;
font-size: 12px;
}
@omaraboumrad
omaraboumrad / fiddle.html
Last active December 25, 2015 23:39
sprite management w/ test
<div id="qunit"></div>
<div id="qunit-fixture"></div>
@omaraboumrad
omaraboumrad / bot.go
Created January 2, 2016 08:16
irc bot in golang
package main
import (
"bufio"
"fmt"
"gopkg.in/ini.v1"
"net"
"os"
"regexp"
"strings"
@omaraboumrad
omaraboumrad / sample.py
Last active January 2, 2016 08:18
http url router
from toll import run, Toll
app = Toll(__name__)
@app.route(r'^/$')
def index():
return 'Hello World'
import operator
import collections
class Rule(object):
def __init__(self, logic, left=None, right=None, op=None, inv=False):
self.logic = logic
self.left = left
self.right = right
self.op = op
self.inv = inv
@omaraboumrad
omaraboumrad / checkdependents.py
Created February 26, 2016 10:11
Check pip dependants instead of requires
# Invert all requirements: python checkdependents.py
# View specific: python checkdependents.py somepackage
import collections
import sys
import pip
def invert_dependencies_graph(distributions):
packages = collections.defaultdict(list)
@omaraboumrad
omaraboumrad / git-cdiff
Last active June 16, 2016 13:40
GitHub-like commit differences
#!/usr/bin/env python
"""
Checks the commit difference between current branch and target branch
a la GitHub.
Usage:
$ git cdiff upstream/master
This branch is 5 commits ahead, 10 commits behind upstream/master.
@omaraboumrad
omaraboumrad / visualize.py
Last active October 28, 2016 13:45
Create a block diagram from a python class hierarchy using blockdiag
"""
Dependencies: pip install blockdiag
Run: python visualize.py
"""
from blockdiag import parser, builder, drawer
TEMPLATE = """
blockdiag {{ orientation = portrait
{}
@omaraboumrad
omaraboumrad / TransitionButton.java
Created November 18, 2016 14:49
android declarative activity transition
package info.aboumrad.transitiontest;
import android.content.Context;
import android.content.Intent;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class TransitionButton extends Button {
@omaraboumrad
omaraboumrad / config.json
Last active December 20, 2016 11:21
irc bot written in javascript for nodejs
{
"nickname": "xnodeuser",
"username": "xnodeuser",
"hostname": "myhost",
"servername": "myserver",
"realname": "xnodeuser",
"channel": "#xnodeuser"
}