Skip to content

Instantly share code, notes, and snippets.

View martijndwars's full-sized avatar

Martijn Dwars martijndwars

View GitHub Profile
@kogakure
kogakure / .gitignore
Last active December 17, 2023 08:21
Git: .gitignore file for LaTeX projects
*.acn
*.acr
*.alg
*.aux
*.bak
*.bbl
*.bcf
*.blg
*.brf
*.bst
@vxnick
vxnick / gist:380904
Created April 27, 2010 15:52
Array of country codes (ISO 3166-1 alpha-2) and corresponding names
<?php
$countries = array
(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
@hgmnz
hgmnz / query_planner.markdown
Created March 23, 2011 14:14
PostgreSQL query plan and SQL performance notes

Types of index scans

Indexes

Sequential Scan:

  • Read every row in the table
  • No reading of index. Reading from indexes is also expensive.
@uarun
uarun / filetype.vim
Created August 3, 2011 19:32
Gradle syntax highlighting in vim
# ~/.vim/filetype.vim
au BufNewFile,BufRead *.gradle setf groovy
@clintel
clintel / gist:1155906
Created August 19, 2011 02:40
Fenced code in bullet lists with GitHub-flavoured MarkDown??

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    Code
    More Code
    
@arian
arian / collegedownloader.sh
Last active June 5, 2017 21:05
Download TU Delft Collegerama video streams, Silverlight player sucks.
#!/bin/bash
slides=1;
video=1;
for var in "$@"
do
if [ "${var}" = "--slidesOnly" ]; then
video=0;
@yano3
yano3 / gist:1378948
Created November 19, 2011 15:17
git commit --amend --reset-author
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 29, 2024 16:03
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jaspernbrouwer
jaspernbrouwer / one-to-many-to-one.php
Created December 8, 2012 14:34
Basic Doctrine 2 one-to-many/many-to-one association setup
<?php
/*
* This is a basic setup for Doctrine 2 one-to-many/many-to-one associations.
*
* There are many alternative approaches, additions and optimizations possible,
* but this example is only meant to help people getting started with the concept.
*/
namespace My\Entity;
@erwinvaneyk
erwinvaneyk / BNPM.py
Last active December 23, 2015 04:39
Simple "Binomial Non-Arbitrage Pricing model (BNPM)" simulator, based upon the first 2 paragraphs of the book of Steven Shreve.
# A simple "Binomial Non-Arbitrage Pricing model (BNPM)" simulator. Requires python 2.x
import sys;
steps = ("--steps" in sys.argv); # if --steps is included, BNPM.py will show all V-values.
PUT = "p"; CALL = "c";
class Stock:
tail = head = None;
val = -1.0;
period = 0;