Skip to content

Instantly share code, notes, and snippets.

View psobot's full-sized avatar

Peter Sobot psobot

View GitHub Profile
@psobot
psobot / excluded_sources.txt
Last active January 26, 2018 14:41
"The Street Preacher" - hyper-local twitter bot
<a href="http://foursquare.com" rel="nofollow">foursquare</a>
<a href="http://instagram.com" rel="nofollow">Instagram</a>
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@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
@cbhl
cbhl / video_trimmer.py
Created October 13, 2012 21:50
Trimming a video in Python
from subprocess import Popen, PIPE, STDOUT
import subprocess
import math, sys
from time import sleep
from os import path, access, W_OK, R_OK, F_OK
def cut(movie, start, clip):
subprocess.Popen(["ffmpeg", #Calls ffmpeg program
"-ss",str(start), #Begining of recording, must be string
"-t", '30', #How long to record clip for, must be a string
@mtowers
mtowers / README.md
Last active February 24, 2022 17:19
Google Analytics Website Visitor Count Widget for Dashing with OAuth2 Authentication
@joseph39
joseph39 / readme.md
Last active December 3, 2021 14:45
Runtime.s for Mac OS X and Windows

Runtime.s for Mac OS X and Windows

These versions of runtime.s works by simulating the break region that is not present in either operating system. The region that it initially allocates is 4MB in size and can be increased by modifying the brk_region_size value. In case where it does run out of memory, it will jump to __exception and consequently terminate the process.

Mac OS X

runtime.s for Mac OS X does not have any library dependencies.

Windows

@andik
andik / sfzparser.py
Last active November 11, 2016 20:28
super simple SFZ Parser in Python (Python 2.7)
# i claim no copyright on this code and place it in the public domain.
# do whatever you want with this code...
import argparse
parser = argparse.ArgumentParser(description='show differences of two views')
o = parser.add_argument
o('files', type=str, help='files to process', nargs='+')
#o('-b', '--boolarg', action='store_true', help="")
#o('-s', '--strarg', help="")
args = parser.parse_args()
@MichaelCurrie
MichaelCurrie / autopep8 Travis-CI.md
Last active April 26, 2021 17:18
Automatically fix PEP-8 issues using Travis-CI

PEP-8 is a set of Python style recommendations. pep8 is a module that checks your .py file for violations. To make your Travis-CI build fail if you have any violations, you could add these lines to your .travis.yml:

before_install:
    - pip install pep8
    
script:
    # Run pep8 on all .py files in all subfolders
    # (I ignore "E402: module level import not at top of file"
    # because of use case sys.path.append('..'); import <module>)
@john-kurkowski
john-kurkowski / override-test-adapter-exception-test.js
Created March 1, 2016 02:34
My answer to "How to test Ember error substate, with Ember CLI test runner?" http://stackoverflow.com/q/34074386/62269
import Ember from 'ember';
import moduleForAcceptance from '../helpers/module-for-acceptance';
import sinon from 'sinon';
const { Test } = Ember;
moduleForAcceptance('Acceptance | error', {
beforeEach() {
this.sandbox = sinon.sandbox.create();
def sliding_window(data, size, stepsize=1, padded=False, axis=-1, copy=True):
"""
Calculate a sliding window over a signal
Parameters
----------
data : numpy array
The array to be slided over.
size : int
The sliding window size