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 | |
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
import sys | |
IS_TERM=False | |
if sys.stdout.isatty(): | |
IS_TERM = True | |
if IS_TERM: |
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/env python | |
from __future__ import print_function | |
import sys | |
def strip_comments(instr): | |
outStr = "" | |
for line in instr.split('\n'): | |
outStr+= line.split('//')[0] + '\n' | |
return outStr |
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
typedef int j;j p(j t,j l){for(;l;--l)putchar(t);} | |
j main(j c,j**v){j i,h=5;c>1?h=atoi(v[1]):0;h=1<<h;j b=h;for(;b;){b/=2; | |
for(i=b?h/b:0;i;i--)p(32,b-1),p(!(i%2)*32+32,1);p(10,1);}} | |
//Prints the following: | |
// | |
// @ | |
// @ @ | |
// @ @ @ @ | |
// @ @ @ @ @ @ @ @ |
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 | |
echo('<pre>'); | |
function p($i, $l){ | |
for ($x=0;$x<$l; ++$x){ | |
echo(chr($i));} | |
} | |
function mk_tree($h=5){ | |
$i=0;$h=1<<$h;$b=$h; | |
while ($b>1){ |
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 | |
function tuxsay($str,$M=40){ | |
$W=strlen($str); | |
if($W>$M) $W=$M; | |
$tux_array=array(10,32,32,32,92,10,32,32,32,32,92,10,32,32,32,32,32,32,32,32,46,45,45,46,10,32,32,32,32,32,32,32,124,111,95,111,32,124,10,32,32,32,32,32,32,32,124,58,95,47,32,124,10,32,32,32,32,32,32,47,47,32,32,32,92,32,92,10,32,32,32,32,32,40,124,32,32,32,32,32,124,32,41,10,32,32,32,32,47,39,92,95,32,32,32,95,47,96,92,10,32,32,32,32,92,95,95,95,41,61,40,95,95,95,47,10); | |
$str=wordwrap($str,$W,"\n",1); | |
echo($str.implode(array_map(function($x){return chr($x);}, $tux_array)) ); | |
} | |
tuxsay("This is a testing thing that may or may not work."); |
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
ffmpeg -re -i "some_file.mkv" -c:v libx264 -crf 18 -preset veryfast -async 1 -maxrate 1500k -c:a aac -strict experimental -b:a 192k -ar 44100 -ac 2 -bsf:v h264_mp4toannexb -maxrate 1000k -bufsize 3000k -f mpegts udp://127.0.0.1:1234 |
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
use std::os; | |
use std::num::Int; | |
// Helper function to print out single characters repeatedly. | |
fn repeat_char(ch: char, mut n: i32){ | |
while n > 0 { | |
print!("{}", ch.to_string()); | |
n = n-1; | |
} | |
} |
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
# This is the pseudocode for the actual code where I found this error | |
def big_function_to_handle_many_different_cases(varA, varB): | |
temporary_buffer = "" | |
def do_the_boilerplate(): | |
SOME_GLOBAL_ARRAY.append(temporary_buffer) | |
temporary_buffer = "" # Reset the temporary_buffer | |
for thing in varA: |
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/bash | |
# Ping-speaker oneliner | |
# This shell oneliner will ping a host once twice every second, then call my | |
# custom text-to-speech program to speak that output. This is meant to act | |
# similarly to the classic story of a use for ping found here: | |
# http://ftp.arl.mil/mike/ping.html | |
# Be aware, I wrote this to work on Cygwin on my system specifically. It also |
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
# Original | |
# function cd { command cd $@ > /dev/null; echo -ne "\r\e[1A\e[J"; } | |
# Written by Kate Adams: https://github.com/KateAdams | |
function cd { | |
command cd $1 > /dev/null # pipe stdout, but not stderr | |
local ret=$? | |
if [[ $ret == 0 ]]; then |