Job Description | Actual meaning |
---|---|
A fast-paced environment | Your job will be constant firefighting |
A market leader | Recently started making a profit |
Able to work with minimal spervision | You'll be the one we blame when something goes wrong |
An Agile team | We have daily stand-ups |
Dynamic environment | Our leadership keeps changing priorities |
Must be a team player | Must not question authority |
Ninja | You do all the work alone |
Passionate | You wil |
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
## https://gist.github.com/ilius/71cfdeb004b568ecd40c | |
from heapq import heappush, heappop | |
def hsortStream(stream, maxHeapSize, key=None): | |
""" | |
stream: a generator or iterable | |
maxHeapSize: int, maximum size of heap | |
key: a key function, as in `list.sort` method, or `sorted` function |
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
''' | |
jd - ordinal = 1721425 | |
jd = ordinal + 1721425 | |
ordinal = jd - 1721425 | |
>>> date=(2015, 12, 19) ; gregorian.to_jd(*date) - datetime(*date).toordinal() | |
1721425 | |
''' |
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 | |
include('Crypt/RSA.php'); | |
$rsa = new Crypt_RSA(); | |
$rsa->loadKey('<RSAKeyValue> | |
<Modulus> | |
... | |
</Modulus> | |
<Exponent>AQAB</Exponent> | |
<P> |
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 random | |
def weighted_choice(choices): | |
if isinstance(choices, dict): | |
choices = choices.items() | |
total = sum(w for c, w in choices) | |
r = random.uniform(0, total) | |
upto = 0 | |
for c, w in choices: | |
if upto + w >= r: |
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 | |
git show-ref --abbrev --heads | sed 's/refs\/heads\///g' | sort | uniq -w 7 -D |
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 | |
import os, sys | |
def getDateTime(imPath):## output sample: '2005:01:01_12:02:16' | |
if not os.path.exists(imPath): | |
print 'Error: Image file \''+imPath+'\' dose not exit!' | |
sys.exit(1) | |
if os.path.isdir(imPath): | |
print 'Error: \''+imPath+'\' is a directory!' | |
sys.exit(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
import random | |
from math import log | |
''' | |
findMaxDisplace = lambda array: \ | |
max( | |
origIndex - sortedIndex \ | |
for sortedIndex, (origIndex, value) in \ | |
enumerate( | |
sorted( |
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/env perl | |
=dependencies: | |
sudo cpan get Mojolicious | |
sudo cpan get MongoDB | |
sudo cpan get Set::Light | |
sudo cpan get Log::Log4perl | |
sudo cpan get DateTime::Format::Strptime | |
sudo cpan get File::HomeDir | |
sudo cpan get Digest::SHA1 |
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
create or replace function epoch_to_jd(float) RETURNS int as $$ | |
BEGIN | |
return ($1 / (24*3600) + 2440588)::int; | |
END; | |
$$ LANGUAGE plpgsql; | |
create or replace function timestamp_to_jd(timestamp with time zone) RETURNS int as $$ | |
BEGIN | |
return epoch_to_jd(extract (epoch from $1)); |