Skip to content

Instantly share code, notes, and snippets.

View dideler's full-sized avatar

Dennis Ideler dideler

View GitHub Profile
@arirusso
arirusso / saturation1.rb
Created March 28, 2012 00:42
ruby-processing: video capture w/ saturation filter
#!/usr/bin/env ruby
# only show pixels that pass a certain threshold of color saturation
class SaturationFilter < Processing::App
load_library :video
include_package "processing.video"
def setup
@arirusso
arirusso / capture-to-file.rb
Created March 28, 2012 04:20
ruby-processing: video capture to a file
#!/usr/bin/env ruby
# this is a test of ruby-processing (https://github.com/jashkenas/ruby-processing) where
# captured video is written to a QuickTime file
# use "rp5 unpack library" at a command line to install the video library if you haven't
# tested with Ruby 1.9.2 on OSX with built in web cam
class VideoCaptureToFileTest < Processing::App
@dieterplex
dieterplex / request_time.py
Created April 26, 2012 07:19 — forked from andrewwatts/request_time.py
urllib2 vs urllib3 vs requests
#!/usr/bin/env python2.7
import urllib2
import time
_ITERATIONS = 200
start_time = time.time()
for i in range(0, _ITERATIONS):
@mrdoob
mrdoob / gist:3504305
Created August 28, 2012 20:58
Renaming files in a folder consecutively.
import os
for i, filename in enumerate(sorted(os.listdir("."))):
os.rename(filename, "{0}.png".format(i))
@uhziel
uhziel / unameh.sh
Created September 6, 2012 05:08
human version of uname
unameh()
{
echo "kernel-name: $(uname --kernel-name)"
echo "nodename: $(uname --nodename)"
echo "kernel-release: $(uname --kernel-release)"
echo "kernel-version: $(uname --kernel-version)"
echo "machine: $(uname --machine)"
echo "processor: $(uname --processor)"
echo "hardware-platform: $(uname --hardware-platform)"
echo "operating-system: $(uname --operating-system)"
@jlfwong
jlfwong / progdiff.sh
Created October 3, 2012 20:07
Diff the stdout, stderr and return code of two programs with piped input and arguments
#!/bin/bash
sandbox="$(mktemp -d)"
hasstdin=false
if [ ! -t 0 ]; then
cat <&0 > "$sandbox/stdin.txt"
hasstdin=true
fi
@fosslc
fosslc / Freeseer.md
Created November 30, 2012 23:21
Freeseer project

Overview

The Freeseer project is a powerful software suite for capturing video. It enables you to capture great presentations, demos, training material, and other videos. It handles desktop screen-casting with ease. It is one of a few such tools that can also record vga output. It is particularly good at handling large conferences with hundreds of talks. Freeseer can run on a laptop with commodity hardware such as a web cam, camcorder, or vga capture device. The resulting system fits easily into a laptop and can be assembled in under 10 minutes to record any number of presentations/demos/talks.

Freeseer is implemented in Python, uses Qt for its GUI, and quite approachable and easy to learn the code base given it's clear structure and reasonable size (17K lines of code). One can make a significant contribution to Freeseer, perhaps more than many other open source projects.

Freeseer is the best software available for recording large conferences. We have put a lot of thought and automation into work flow to

@SumuduF
SumuduF / card_game.py
Created February 3, 2013 21:30
Solutions for Facebook Hacker Cup 2013 / Round 1 No explanations for now...
import sys
MOD = 1000000007
def main():
for (i, (n, k, cards)) in enumerate(testcases()):
print "Case #{0}: {1}".format(i+1, subsum(n, k, cards))
def testcases(cin=sys.stdin):
m = int(cin.next())
@SumuduF
SumuduF / cake_cutting.py
Last active December 12, 2015 08:59
Solutions for Facebook Hacker Cup Round 2 I got stuck on problem 2 during the actual round due to a bit of a nasty off-by-one error (fixed below); in retrospect it would have been better to try #3 to have a chance at qualifying. Added solution to problem #3; essentially a standard DP on a tree + a bit of cleverness to ensure proper counting. Dur…
import sys
def main():
for (i, (n, a)) in enumerate(testcases()):
print "Case #{0}: {1}".format(i+1, regions(n, a))
def testcases(cin=sys.stdin):
nc = int(cin.next())
for _ in xrange(nc):
nums = map(int, cin.next().split())
@rikukissa
rikukissa / .gitignore
Last active December 17, 2015 17:18
Darker theme for Shout. Has a bit more eye-friendly color scheme and hides some IMO unnecessary features such as "Leave" and "Submit" buttons.
.DS_Store