Skip to content

Instantly share code, notes, and snippets.

View adamatan's full-sized avatar

Adam Matan adamatan

View GitHub Profile
@adamatan
adamatan / asciidoc-syntax-quick-reference.adoc
Created July 2, 2018 05:04 — forked from mojavelinux/asciidoc-syntax-quick-reference.adoc
AsciiDoc Syntax Quick Reference (sample document)

AsciiDoc Syntax Quick Reference

@adamatan
adamatan / git_branch.sh
Created April 28, 2018 20:08
Bash script for getting the git branch name
#!/bin/bash
# Credit: https://git-blame.blogspot.co.il/2013/06/checking-current-branch-programatically.html
branch=$(git symbolic-ref --short -q HEAD)
if [ "$branch" != "master" ]
then
suffix="/branch/$branch"
else
@adamatan
adamatan / install.sh
Created April 17, 2018 09:21
Install Node.js on an Ubuntu Docker container
#!/bin/bash
# Credit: https://gist.github.com/garystafford/07fbfe8fde48c3f5810c
apt-get update -yq && apt-get upgrade -yq && apt-get install -yq curl git nano
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get install -yq nodejs build-essential
npm install -g npm
@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 . .
@adamatan
adamatan / pasuk.txt
Created March 29, 2017 20:47
Who said Jehova?
וַיִּשְׂאוּ מִשָּׁם אֵת אֲרוֹן בְּרִית-יְהוָה צְבָאוֹת, יֹשֵׁב הַכְּרֻבִים; וְשָׁם שְׁנֵי בְנֵי-עֵלִי, עִם-אֲרוֹן בְּרִית הָאֱלֹהִים
@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 / 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('!!!!!', '♥', '...')
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 / 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
@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'