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
| FILE=~/speedtestdata | |
| date "+%Y-%m-%d %H:%M" | tee -a $FILE | |
| echo "-----------------------" | tee -a $FILE | |
| ~/dev/speedtest-cli --list | tail -n +3 | head -n8 | while read line; do | |
| echo $line | tee -a $FILE | |
| (~/dev/speedtest-cli --simple --server $(echo $line | sed -e "s/).*/ /g") \ | |
| && echo) \ | |
| | tee -a $FILE | |
| done |
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 | |
| OUTPUT=$1 | |
| shift | |
| ffmpeg -f concat -i <( | |
| while [[ $# > 0 ]]; do | |
| printf "file '$PWD/$1'\n" | |
| shift | |
| done |
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 Interect | |
| { | |
| /** | |
| * Return intersecting array of varargs arrays. | |
| * Compares keys and values. Checks recursively. | |
| * Returns empty array if no intersection. | |
| * |
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
| package main | |
| import "fmt" | |
| func countGenerator() func() int{ | |
| // state | |
| c := make(chan int) | |
| var i int | |
| // generator | |
| go func(){ |
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 | |
| const MALE = 1; | |
| const FEMALE = 0; | |
| $leftFemale = 0; | |
| $rightFemale = 0; | |
| $i = 0; | |
| while (true) { | |
| $frogLeft1 = rand(0,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
| package main | |
| import ( | |
| "fmt" | |
| "sync" | |
| "testing" | |
| ) | |
| var lockChannel chan bool = make(chan bool, 1) | |
| var lockSync sync.Mutex |
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
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.Random; | |
| public class FindStreaks { | |
| public static void main(String[] args) { | |
| int[] array = new int[Integer.MAX_VALUE/32]; | |
| Random rand = new Random(); | |
| int maxInt = 10000; |
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
| cat VIDEO_TS/VTS_01_[1234].VOB | nice ffmpeg -i - ~/dvd_rip.mp4 |
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 BinaryPrint { | |
| static void print(int number) { | |
| int mask = 1<<31; | |
| while ((number <<= 1) != 0) { | |
| System.out.print(((number & mask) != 0) ? 1 : 0); | |
| } | |
| } | |
| } |
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
| import java.util.function.IntFunction; | |
| public class ConstructorReference { | |
| public static void main(String...args) { | |
| IntFunction<Integer> intMakerSingle = Integer::new; | |
| int intSingle = intMakerSingle.apply(40); // int value | |
| IntFunction<int[]> intMakerArray = int[]::new; | |
| int[] intArray = intMakerArray.apply(100); // array size | |
| } |