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
{,pac}man |
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 | |
cat "$1" \ | |
| php -r \ | |
'foreach(token_get_all(file_get_contents("php://stdin")) as $token){ | |
echo is_array($token) | |
?token_name($token[0]).":\t$token[1]\n" | |
:"$token\n"; | |
};' \ | |
| less |
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 | |
namespace V6; | |
/** | |
* @author Vít Šesták 'v6ak' | |
* @license BSD | |
*/ | |
final class NamespacedLoader { | |
private $path; |
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 'runkit.internal_override:', ini_get('runkit.internal_override'), "\n"; | |
//ini_set('runkit.internal_override', true); // Does not work, because it is PHP_INI_SYSTEM | |
runkit_function_rename('register_shutdown_function', 'v6ak_internal_register_shutdown_function'); // You have to enable runkit! | |
if(true){ // It reports redeclaration of function without whis. | |
function register_shutdown_function($func){ | |
$args = func_get_args(); | |
array_shift($args); | |
v6ak_internal_register_shutdown_function(function() use($args){ | |
try{ |
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
filterPrimes (x:xs) = x:filterPrimes (filter isNotDivisible xs) where isNotDivisible n = (n `mod` x) /= 0 | |
primes = filterPrimes [2,3..] | |
main = print (takeWhile (<100000) primes) |
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
object Primes extends Application{ | |
def sieve(s:Stream[Int]):Stream[Int] = Stream.cons(s.head, sieve(s.tail.filter(_%s.head != 0))) // Sieve of Eratosthenes | |
val primes = sieve(Stream from 2) // Stream of all primes | |
primes take 10 foreach println // print first 10 primes | |
} |
This file has been truncated, but you can view the full file.
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
main = print ((( | |
curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurry.curry.uncurr |
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
import scala.util.Random | |
import java.util.NoSuchElementException | |
class Tree (val food:String, val n:Double, val ord:Int, val children:List[Tree]){ | |
def value = "(\""+food+"\", "+n+")"; | |
override def toString = toString(0, " | ", " -"); | |
def toString(indent:Int, indentString:String, elString:String):String = "["+ord+"]\t"+indentString*indent +elString +value+ |
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
def timeBench(t: =>Unit, count: Int){ | |
val t1 = System.currentTimeMillis | |
try{ | |
(1 to count).foreach{x => | |
t/*()*/ | |
} | |
}finally{ | |
val t2 = System.currentTimeMillis | |
val timeSec = (t2-t1)/1000.0; | |
println("\ntotal time:\t" + timeSec + "s"); |
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
adb shell | |
su | |
mount -o rw,remount /dev/block/mtdblock0 /system;D=/system/bin/;BB=${D}busybox;for i in $($BB|$BB grep -e "\,$"); do n=$(echo -n "$i"|$BB sed s/,//);ln -s $BB "$D$n";done;mount -o ro,remount /dev/block/mtdblock0 /system |