This file contains hidden or 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
#include <stdio.h> | |
#include <iostream> | |
#include <string> | |
#include <string.h> | |
/** | |
* This simple argv parser splits a command like: | |
* ffmpeg -f libx264 -i input.avi -acodec libmp3lame -ab 128k -ar 44100 -vcodec | |
* mpeg2video -vf scale=160:128 -b 176k -r 15 -strict -1 -ab output.mpg | |
* |
This file contains hidden or 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
#include <iostream> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string> | |
using std::string; | |
char* |
This file contains hidden or 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
class SomeParentClass: | |
""" @class SomeParentClass | |
An arbitrary class. | |
""" | |
def __init__(self): | |
pass | |
def some_member_function(self, var): | |
""" This function takes in a variable and places it into a nested |
This file contains hidden or 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 unload | |
{ | |
match=$(grep --text --line-number '^PAYLOAD:$' $0 | cut -d ':' -f 1) | |
pay_start=$((match + 1)) | |
tail -n +$pay_start $0 | tar -xzvf - | |
} |
This file contains hidden or 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 TestAchat | |
{ | |
var $ref; | |
public function __construct(&$ref_val) | |
{ | |
$this->ref = &$ref_val; | |
$this->ref = "words"; | |
} |
This file contains hidden or 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
if ((write_len = write(out_pipe, buffer, | |
read_len = read(sock, buffer, BUF_SIZ))) | |
!= read_len) | |
fprintf(stderr, "%s\n", "Error!"); |
This file contains hidden or 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
IFS=': ' read -a mimetype <<< "`file $0`" ; echo "PIP THE MAGIC ${mimetype[1]}" | |
IFS=': ' read -a mystery <<< "`file $0`" ; echo "PIP THE MAGIC ${mystery[1]}" |
This file contains hidden or 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 | |
# DOES NOT WORK -------------------------------------------------------------- # | |
def does_not_work(): | |
from sys import stderr, stdout | |
_stdout = stdout | |
stdout = stderr | |
print('does_not_work()') |
This file contains hidden or 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/bash | |
set -e | |
MAKE_COUNT=4 | |
if [ "`grep -c /etc/apt/sources.list deb-multimedia`" == "0" ]; | |
then | |
echo "deb http://www.deb-multimedia.org squeeze main non-free" >> /etc/apt/sources.list | |
apt-get install -y --force-yes deb-multimedia-keyring |
This file contains hidden or 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 | |
def __unit(val): | |
if not val[-1:].isalpha(): | |
return val | |
if len(val) <= 1 or val[-2:-1].isalpha(): | |
raise RuntimeError('invalid units') | |
i = int(val[:-1]) |
OlderNewer