Skip to content

Instantly share code, notes, and snippets.

View ibaaj's full-sized avatar

Ismaïl Baaj ibaaj

  • Paris, France
View GitHub Profile
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
anonymous
anonymous / gist:418834
Created May 30, 2010 06:28
digraph mainmap {
resolution = 72;
node [fontsize = 10];
edge [fontsize = 9];
overlap = false;
sep=0.4
splines=true;xSatisfiability [label= "SATISFIABILITY" URL= "http://en.wikipedia.org/wiki/Satisfiability"style="bold", shape="ellipse", peripheries="2", fontsize ="14"];
xCircuitSatisfiability [label= "CIRCUIT SATISFIABILITY" URL= "" style ="filled", fillcolor ="#eeeeee" style="bold", shape="ellipse", peripheries="2", fontsize ="14"];
xMaxCut [label= "MAX CUT" URL= "http://en.wikipedia.org/wiki/Cut_(graph_theory)#Minimal_and_maximal_cuts"];
xJobSequencing [label= "JOB SEQUENCING" URL= "" style ="filled", fillcolor ="#eeeeee" ];
@tahl
tahl / installer.sh
Created June 15, 2011 06:56
Android SDK + NDK + Eclipse and ADB Installer
#!/bin/bash
#
#This script is designed to install the Android SDK, NDK, and Eclipse in Linux Mint 11 and make it easier for people that want to develop for Android using Linux.
#Script written by @ArchDukeDoug with special thanks to @BoneyNicole, @tabbwabb, and @animedbz16 for putting up with me and proofreading and/or testing the script.
#I can be reached at dougw@uab.edu, twitter, or linuxrandomly.blogspot.com
#Script version: 1.0.5
#Changelog: 1.0.5 - Fixed the Android SDK search parameters to fit the new naming scheme on http://developer.android.com/sdk
i=$(cat /proc/$PPID/cmdline)
if [[ $UID != 0 ]]; then
echo "Please type sudo $0 $*to use this."
@mkroman
mkroman / Network.cpp
Created November 17, 2011 01:42
Uncrustify configuration inspired by Google's C++ styleguide.
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <string.h>
#include <iostream>
#include <stdarg.h>
#include <stdio.h>
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 10, 2024 16:49
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@willurd
willurd / web-servers.md
Last active May 10, 2024 05:14
Big list of http static server one-liners

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
@brunoro
brunoro / pollard_rho.py
Created June 30, 2013 06:46
Pollard's Rho algorithm for discrete logs as described on (HAC 3.6) - http://cacr.uwaterloo.ca/hac/
#!/usr/bin/env python
# encoding: utf8
# HAC 3.61: generates x_{i+1}, a_{i+1} and b_{i+1}
# from a, b and c, partitioning the field
def step_xab(x, a, b, alpha, beta, n, Z):
s = x % 3
# S1
if s == 1:
@jeremiahsnapp
jeremiahsnapp / MITM -SSL-Proxies.md
Last active November 14, 2023 07:48
Man In The Middle (MITM) SSL Proxies - Simple ways to see traffic between an SSL server and client in clear text.

HTTP(S) specific MITM SSL Proxies

mitmproxy

mitmproxy is an excellent console app written in Python.

It is easy to use on Linux and OS X.

Use brew install mitmproxy to install it on OS X.

@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active February 12, 2024 17:18
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@thomasfr
thomasfr / iptables.sh
Last active April 13, 2024 01:59
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers