Skip to content

Instantly share code, notes, and snippets.

View mgalgs's full-sized avatar
🍔
pizza

Mitchel Humpherys mgalgs

🍔
pizza
View GitHub Profile
@mgalgs
mgalgs / zIndexTest.html
Created January 22, 2011 18:54
The zIndex option for the circle object in the Google Maps API doesn't seem to be working correctly... This is a minimal example showing the behavior.
<html>
<head>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?libraries=geometry&sensor=false"></script>
<script type="text/javascript">
function initialize() {
var cntr = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 14,
@mgalgs
mgalgs / haf.cpp
Created June 23, 2011 17:23
hand and foot program
// -*- mode: c++; compile-command: "g++ -g -o haf haf.cpp"; -*-
// hand and foot scoring program by Joseph Mickelson
#include <iostream>
#include <stdio.h> //for printf
#include <vector>
#include <numeric> //for accumulate
#ifdef __linux__
#include <stdlib.h>
#endif
@mgalgs
mgalgs / neercs-patch-patch.patch
Created June 25, 2011 00:02
neercs PKGBUILD tiny patch
diff -c /home/mgalgs/abs/neercs-git/PKGBUILD.orig /home/mgalgs/abs/neercs-git/PKGBUILD
*** /home/mgalgs/abs/neercs-git/PKGBUILD.orig 2011-06-24 17:01:37.858847642 -0700
--- /home/mgalgs/abs/neercs-git/PKGBUILD 2011-06-24 16:59:40.155520196 -0700
***************
*** 35,40 ****
--- 35,41 ----
rm -rf "$_gitname"-build
git clone "$_gitname" "$_gitname"-build
cd "$_gitname"-build
+ git apply "${startdir}/0001-bogus-tab-key-and-copyright.patch"
@mgalgs
mgalgs / so6738840.html
Created July 18, 2011 20:22
jQuery Toggle html characters +/-
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$('a.toggler').click(function() {
var $this = $(this);
console.log($this.next(".hidden"));
$this.next(".hidden").slideToggle("fast", function() {
(defun ido-completing-read-multiple (prompt choices &optional predicate require-match initial-input hist def sentinel)
"Read multiple items with ido-completing-read. Reading stops
when the user enters SENTINEL. By default, SENTINEL is
\"*done*\". SENTINEL is disambiguated with clashing completions
by appending _ to SENTINEL until it becomes unique. So if there
are multiple values that look like SENTINEL, the one with the
most _ at the end is the actual sentinel value. See
documentation for `ido-completing-read' for details on the
other parameters."
(let
# Maintainer: Mitchel Humpherys <mitch.special@gmail.com>
pkgname=python-matplotlib-git
pkgver=20111116
pkgrel=1
pkgdesc="matplotlib python library (including python3 support)"
url="https://github.com/matplotlib/matplotlib"
arch=('any')
license=('custom')
depends=('python-numpy' 'python3-dateutil' 'python-pytz' 'freetype2' 'libpng')
# Maintainer: Marcin Skory <armitage at gfreedom dot org>
# Contributor: Arkham <arkham at archlinux dot us>
# Contributor: Christoph Zeiler <archNOSPAM_at_moonblade.dot.org>
# Contributor: Jacek Poplawski <jacekpoplawski__gmail>
# Contributor: Mitchel Humpherys <mitch.special@gmail.com>
pkgname=alephone
pkgver=20111201
pkgrel=1
pkgdesc='A free, enhanced port of the classic FPS "Marathon 2" by Bungie Software'
# Maintainer: Marcin Skory <armitage at gfreedom dot org>
# Contributor: Christoph Zeiler <rabyte*gmail>
# Contributor: Mitchel Humpherys <mitch.special@gmail.com>
pkgname=alephone-marathon
pkgver=20111201
pkgrel=2
pkgdesc="Marathon 1 scenario data files"
arch=('any')
url="http://trilogyrelease.bungie.org/"
@mgalgs
mgalgs / scapy_bridge.py
Created February 18, 2012 00:58
python ethernet bridge
#!/usr/bin/python2
import sys
import signal
from threading import Thread,Lock
from scapy.all import sniff,IP,sendp,srp1,Ether,ARP,get_if_list,get_if_hwaddr
def usage():
print 'Usage: scapy_throuput.py host1_interface host1_ip host2_interfcae host2_ip'