Skip to content

Instantly share code, notes, and snippets.

\documentclass[oneside,11pt]{book}
\usepackage[a4paper,top=40mm,bottom=40mm,left=61mm,right=61mm,,headheight=0in]{geometry}
\usepackage{lettrine}
\usepackage[final]{microtype}
\directlua{}
\usepackage{fontspec}
\usepackage{xspace}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% babel for the Hebrew
@jdh30
jdh30 / InstallOCaml.sh
Last active December 13, 2020 08:04
Script to install and initialize OCaml for microservice development (TCP+HTTP+JSON) on an Ubuntu Linux box (e.g. in Amazon's AWS Cloud)
# .NET Core 2.1 with Ubuntu Server 18.04 - Version 1.0 - ami-f4f4cf91
sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)
sudo apt-get update
sudo apt-get install make m4 gcc zip aspcud emacs libssl-dev ncurses-dev pkg-config tuareg-mode libffi-dev bubblewrap linux-tools-common linux-tools-aws
opam init
eval $(opam env)
opam install ocamlfind core async async_ssl cohttp yojson ppx_deriving ocp-indent merlin cohttp-async
@Jaza
Jaza / Private-pypi-howto
Last active July 2, 2023 16:24
Guide for how to create a (minimal) private PyPI repo, just using Apache with directory autoindex, and pip with an extra index URL.
*
@lessmilk
lessmilk / main.js
Last active October 31, 2019 14:48
/*
Code of "Dark Bleu" game from www.lessmilk.com/10/
Made with Phaser Javascript framework
Note: the is the main source code. I skiped the boring part (preloading the assets, and the menus)
*/
/*
Programming and art made by www.lessmilk.com
You can freely look at the code below,
@RJ
RJ / Makefile-erlang.mk
Last active November 2, 2019 07:29
Makefile fragment that generates makefile targets to call make with a given target on all apps/* subdirs. Useful for erlang projects using erlang.mk that have apps/{app1,app2,app3..} structure (which rebar doesn't mind). Eg: call "make app" and it will call "make -C apps/app1 app; make -C apps/app2 app; ..." for you.
APPDIRS := $(wildcard apps/*)
## Example hack to filter one out:
## APPDIRS := $(filter-out apps/fooapp, $(APPDIRS))
define PROXY_TARGET
$(1):
$(foreach appdir,$(APPDIRS),$(MAKE) -C $(appdir) $(1) ;)
endef
@Gorbatchevski
Gorbatchevski / gist:5280623
Last active December 15, 2015 15:19
Translates a word into pig latin
def translate_into_pig_latin(word)
if word[0] == "a"|| word[0]== "e" || word[0] == "i"|| word[0] == "u" || word[0] == "o"
word+"ay"
elsif (word[0] != "a"|| word[0] != "e" || word[0] != "i"|| word[0] != "u") && (word[1] == "a" || word[1] == "o" || word[1] == "e" || word [1] == "i" || word[1] == "u") && word[0..1] != "qu"
word[1..-1]+word[0]+"ay"
elsif (word[0] != "a"|| word[0] != "e" || word[0] != "i"|| word[0] != "u") && (word[1] != "a" || word[1] != "o" || word[1] != "e" || word [1] != "i" || word[1] != "u")
word[2..-1]+word[0..1]+"ay"
elsif word[0..1]="qu"
word[2..-1]+"quay"
else
@mk270
mk270 / amqp-delete-queue.py
Created February 26, 2013 21:07
trivial tool for delete AMQP queues, as Debian squeeze doesn't seem to have my favourite one
#!/usr/bin/env python
import pika
import sys
from optparse import OptionParser
def run():
p = OptionParser()
p.add_option("--hostname", dest="hostname",
default="localhost", help="Hostname of AMQP endpoint")
@benhosmer
benhosmer / app.py
Created October 22, 2012 11:00
bottle.py notes
from bottle import route, run, static_file, request, abort, redirect, view, template
import re
# Serve a static html with templates
# Create an index.tpl and save it in /views
'''
#Sample index.tpl
<html>
<head>
<link rel="stylesheet" type="text/css" href="/static/styles.css" />