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 kotlin.math.* | |
// First, we need to define, what a 'distance' is | |
interface Distance<T> { | |
fun T.distance(to: T): Double | |
} | |
// Now let's define few concrete data classes that will be used to store the data | |
data class Location(val lat: Double, val lon: Double) |
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 kotlin.math.* | |
// First, we need to define, what a 'distance' is | |
interface Distance<T> { | |
fun T.distance(to: T): Double | |
} | |
// Now let's define few concrete data classes that will be used to store the data | |
data class Location(val lat: Double, val lon: Double) |
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
# There is no access from local computer to hostB | |
# There is an access from local computer to hostA | |
# There is an access from hostA to hostB | |
ssh -L 9000:<hostB>:<port> <hostA> |
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 | |
import pycurl | |
import select | |
def write(*args): | |
pass | |
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 pycurl import Curl | |
def write(*args): | |
pass | |
if __name__ == '__main__': |
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 . -wholename '*.py' -type f | xargs -n1 -I {} bash -c 'echo {}; grep -R settings {}' |
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
fn swap(arr: &mut Vec<int>, i: uint, j: uint) -> &Vec<int> { | |
let buf = arr[i]; | |
arr[i] = arr[j]; | |
arr[j] = buf; | |
arr | |
} | |
fn insertion_sort(arr: &mut Vec<int>) -> &Vec<int> { | |
for i in range(1, arr.len()) { | |
let key = arr[i]; |
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 "1234" | gpg --no-use-agent -o /dev/null --local-user <KEYID> -as - && echo "The correct passphrase was entered for this key" |
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
GROUPS := $(shell for i in `echo {0..95..5}`; do echo $$i | awk '{print $$i/100}'; done) |
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
for i in `echo {0..95..5}`; do echo $i | awk '{print $i/100}'; done |
NewerOlder