This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create a thumbnail for a video with ffmpeg | |
ffmpeg -itsoffset -16 -i video.flv -vcodec mjpeg -vframes 1 -an -f rawvideo -s 142x94 thumbnail.jpg | |
# ... | |
video=video.flv; ffmpeg -itsoffset -16 -i $video -vcodec mjpeg -vframes 1 -an -f rawvideo -s 142x94 "`basename $video .flv`.jpg" | |
# remove last charater from filename of JPG files with filename ending in M | |
ls *M.jpg | while read line; do echo mv $line `echo $line | sed 's/\(.*\)M.jpg/\1.jpg/'`; done | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Copyright (c) 2010 Willington Vega, http://wvega.com/ | |
# Licensed under WTFPL (http://sam.zoy.org/wtfpl/) | |
class NaturalSequence: | |
def __init__(self, digit, length=None): | |
"""Creates a stream to generate natural numbers whose first digit is self.digit. | |
if length is given only numbers of that length will be generated""" | |
self.digit = digit | |
self.length = length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name UN Web Authentication | |
// @namespace scripts.wvega.com | |
// @include https://200.24.8.8/login.html | |
// ==/UserScript== | |
var inputs = document.getElementsByTagName('input'), | |
username = inputs[6], | |
password = inputs[7], | |
submit = inputs[8]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* CakePHP fixtures shell */ | |
ini_set('memory_limit', '512M'); | |
require_once CAKE_TESTS_LIB.'cake_test_model.php'; | |
require_once CAKE_TESTS_LIB.'cake_test_fixture.php'; | |
class FixturesShell extends Shell { | |
/** | |
* Truncates all tables and loads fixtures into db | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Generate random colors | |
* source: http://twitter.com/rem/status/15427387974 */ | |
'#' + (~~(Math.random() * 16777215)).toString(16) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# | |
# helper script to quickly setup Apache VirtualHosts on my laptop | |
import os | |
import sys | |
HTTPD_CONF_DIR = '/var/www/conf.d' | |
HTTPD_DOCUMENT_ROOT = '/var/www/html' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import imdb | |
import os | |
import re | |
# (?:\[.+) everything after an opening bracket | |
# (?:(?:\.|\()(?:\d{4}.*)) everything after a period followed by a year |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($, window){ | |
$.LazyLoader = function(elements, options) { | |
var self = this; | |
self.elements = elements; | |
self.timeout = null; | |
self.options = $.extend({}, self.defaults, options); | |
window.bind('scroll.lazyload', function(event) { | |
// clearTimeout(self.timeout); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DESKTOP=/usr/share/applications/minecraft.desktop | |
INSTALL=/usr/local/minecraft | |
JAVA=/usr/java/latest/bin/java | |
MINECRAFT='http://www.minecraft.net/download/minecraft.jar' | |
mkdir $INSTALL | |
cd $INSTALL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compiles cocos2d against installed Android SDK and creates a JAR file | |
# | |
# Usage: | |
# | |
# 1. Checkout latest source | |
# svn checkout http://cocos2d-android.googlecode.com/svn/trunk/ . | |
# 2. Set ${SDK} and ${API} to reflect your current configuration | |
# 3. Run make | |
SDK := /usr/local/android-sdk-linux-86/platforms/ |
OlderNewer