Skip to content

Instantly share code, notes, and snippets.

View adamatan's full-sized avatar

Adam Matan adamatan

View GitHub Profile
@adamatan
adamatan / regev_snapshot.py
Created January 15, 2014 11:29
Take a screenshot from Israeli MP Miri Regev's FB page (she tends to delete posts).
from selenium import webdriver
from PIL import Image
import datetime
filename = "miri_regev_"+datetime.datetime.now().strftime("%Y.%m.%d.%H:%M:%S")+".png"
fox = webdriver.Firefox()
fox.get('https://www.facebook.com/miri.regev.il')
fox.save_screenshot(filename) # saves screenshot of entire page
fox.quit()
@adamatan
adamatan / IETF_BCP_47_languages_ios71.json
Created September 28, 2014 13:57
IETF BCP 47 languages recognized by iOS 7.1
["aa", "ab", "ace", "ach", "ada", "ady", "ae", "af", "afa", "afh", "agq", "ain", "ak", "akk", "ale", "alg", "alt", "am", "an", "ang", "anp", "apa", "ar", "arc", "arn", "arp", "art", "arw", "as", "asa", "ast", "ath", "aus", "av", "awa", "ay", "az", "ba", "bad", "bai", "bal", "ban", "bas", "bat", "bax", "bbj", "be", "bej", "bem", "ber", "bez", "bfd", "bg", "bh", "bho", "bi", "bik", "bin", "bkm", "bla", "bm", "bn", "bnt", "bo", "br", "bra", "brx", "bs", "bss", "btk", "bua", "bug", "bum", "byn", "byv", "ca", "cad", "cai", "car", "cau", "cay", "cch", "ce", "ceb", "cel", "cgg", "ch", "chb", "chg", "chk", "chm", "chn", "cho", "chp", "chr", "chy", "ckb", "cmc", "co", "cop", "cpe", "cpf", "cpp", "cr", "crh", "crp", "cs", "csb", "cu", "cus", "cv", "cy", "da", "dak", "dar", "dav", "day", "de", "del", "den", "dgr", "din", "dje", "doi", "dra", "dsb", "dua", "dum", "dv", "dyo", "dyu", "dz", "dzg", "ebu", "ee", "efi", "egy", "eka", "el", "elx", "en", "enm", "eo", "es", "et", "eu", "ewo", "fa", "fan", "fat", "ff", "fi", "fil
@adamatan
adamatan / git-cheat-sheet.md
Last active August 29, 2015 14:14
git cheat sheet
@adamatan
adamatan / Python.md
Last active March 31, 2016 08:08
My cheat sheets

Python

import datetime
now=datetime.datetime.now()
now.strftime('%Y')                     # '2015'
now.strftime('%Y-%m-%dT%H:%M:%S')      # '2015-05-18T17:36:35'
now.strftime('%Y-%m-%d %H:%M:%S.%f') # '2015-05-18 17:36:35.119869'
@adamatan
adamatan / install.sh
Last active January 25, 2016 13:12
Brew packages for a new mac
#!/bin/bash
brew install tree tidy-html5 htop pstree gdal geoip \
libspatialite librasterlite spatialite-gui spatialite-tools \
watch spatialindex
autoconf geoip json-c libspatialite proj tidy-html5
automake geos lame libtiff protobuf tree
berkeley-db4 gettext libav libtool pstree watch
boost ghostscript libevent libxml2 qt5 wget
cairo giflib libffi little-cms2 readline wxmac
exiftool glib libgaiagraphics lzlib readosm x264
faac gnupg libgeotiff miniupnpc sha2 xvid
fontconfig htop-osx liblwgeom openssl spatialindex xz
freetype httpie libpng ossp-uuid spatialite-gui
freexl imagemagick libpqxx3 pixman spatialite-tools
@adamatan
adamatan / whatsapp_gan.py
Last active September 5, 2016 04:22
Whatsapp callback function for the Gan
import random
def whatsapp_gan_callback(message):
if ('פצע', 'קיא', 'פלסטר', 'לקחת', 'תולעים') in message:
message.respond(random.choice('שיהיה רק בריאות', 'חבל', 'אוי')) + '...'
else:
message.respond(random.choice('חחחחחחח', 'בובונים', 'מהממים', 'מדהים')) + random.choice('!!!!!', '♥', '...')
@adamatan
adamatan / fizzbuzz.py
Last active December 1, 2016 06:24
FizzBuzz in Python
"""A Classic FizzBuzz solution."""
for i in range(1, 101):
if (i%3 == 0) and (i%5 == 0):
print "FizzBuzz"
elif i % 3 == 0:
print "Fizz"
elif i % 5 == 0:
print "Buzz"
else:
@adamatan
adamatan / pasuk.txt
Created March 29, 2017 20:47
Who said Jehova?
וַיִּשְׂאוּ מִשָּׁם אֵת אֲרוֹן בְּרִית-יְהוָה צְבָאוֹת, יֹשֵׁב הַכְּרֻבִים; וְשָׁם שְׁנֵי בְנֵי-עֵלִי, עִם-אֲרוֹן בְּרִית הָאֱלֹהִים
@adamatan
adamatan / Dockerfile
Last active August 15, 2017 14:03
Test app for nomad speed measurement
FROM node
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
COPY package.json .
# For npm@5 or later, copy package-lock.json as well
# COPY package.json package-lock.json .
RUN npm install
# Bundle app source
COPY . .