Skip to content

Instantly share code, notes, and snippets.

View josefnpat's full-sized avatar
what

Seppi josefnpat

what
View GitHub Profile
@josefnpat
josefnpat / justin.tv.sh
Created November 18, 2012 02:00
Ubuntu 10.04 Instructions
#!/bin/bash
INRES="1920x1200" # input resolution
OUTRES="640x480"
OFFSET="0,0"
FPS="15" # target FPS
QUAL="fast" # one of the many FFMPEG preset
STREAM_KEY="your_key_here_sexy"
URL="rtmp://live.justin.tv/app/$STREAM_KEY"
ffmpeg -f x11grab \
@josefnpat
josefnpat / foo.lua
Created November 29, 2012 19:59
Lua 5.1 Module Example
local foo = {}
foo.color = "blue"
function foo.tell()
print(foo.color.." is my favorite color.")
end
return foo
@josefnpat
josefnpat / fooclass.lua
Last active March 12, 2016 14:49
Lua 5.1 OOP example
local fooclass = {}
function fooclass:setColor(color)
self.color = color
end
function fooclass:getColor()
return self.color
end
@josefnpat
josefnpat / minify.php
Created December 1, 2012 21:00
PHP Minify
#!/usr/bin/php
<?php
$file = $argv[1];
if(is_file($file)){
$raw=php_strip_whitespace($file);
$pattern = array();
$replacement = array();
$chars = array(";","}","{","=",",","=>","<",">","<=",">=",".=");
foreach($chars as $char){
$pattern[] = "@\s$char@";
@josefnpat
josefnpat / gist:4220955
Created December 6, 2012 00:51
bijo-linux pics without postfixed 1's
#!/usr/bin/php
<?php
$urls = array(
"http://bijo-linux.com/wp-content/uploads/2012/02/batch.jpg",
"http://bijo-linux.com/wp-content/uploads/2012/02/change.jpg",
"http://bijo-linux.com/wp-content/uploads/2012/02/chatter.jpg",
"http://bijo-linux.com/wp-content/uploads/2012/02/dpkg.jpg",
"http://bijo-linux.com/wp-content/uploads/2012/02/netconfig.jpg",
"http://bijo-linux.com/wp-content/uploads/2012/02/zipgrep.jpg",
@josefnpat
josefnpat / watch.php
Last active December 11, 2015 03:58
#!/usr/bin/php
<?php
$log = "../server.log";
$watch = array();
$watch[] = array('regex'=>"@\\[INFO\\] Starting minecraft server version@",'icon'=>'./Grass.png');
$watch[] = array('regex'=>"@\\[INFO\\] Done \\((.){1,8}s\\)! For help, type \"help\" or \"\\?\"@",'icon'=>'./Grass.png');
$watch[] = array('regex'=>"@\\[INFO\\] (.){1,}\\[/(.){1,}\] logged in with entity id@",'icon'=>'./Head.png');
@josefnpat
josefnpat / mfp
Last active December 8, 2022 22:22
Download all MusicForProgramming(); tracks, if they aren't already downloaded. dep: php & wget
#!/usr/bin/php
<?php
$xml = simplexml_load_file('http://musicforprogramming.net/rss.php');
$songs = array();
foreach($xml->channel->item as $item){
$songs[] = (string)$item->comments;
}
love=$(/usr/bin/env love)
zip=$(/usr/bin/env zip)
luac=$(/usr/bin/env luac)
# path to win and osx distributions
windir=~/Stuff/love-win-x86
osxapp=~/Stuff/love.0.8.app
game=TITLE-OF-THE-GAME.love
Index: interface.c
===================================================================
--- interface.c (revision 2526)
+++ interface.c (working copy)
@@ -2593,7 +2593,12 @@
}
}
-/* Move the current playlist item (direction: 1 - up, -1 - down). */
+/* Move the current playlist item directions:
#!/usr/bin/php
<?php
/* Transmission to Deluge export script
*
* Transmission - transmission-gtk 2.77 (14031)
* Deluge - deluge: 1.3.6
* Script - PHP 5.4.14 (cli)
*
* How to use this script;
* 1) Run `php trans_to_deluge.php` and make sure there aren't any errors.