Skip to content

Instantly share code, notes, and snippets.

View etienneschmitt's full-sized avatar

Etienne Schmitt etienneschmitt

View GitHub Profile
@ShirtlessKirk
ShirtlessKirk / luhn.js
Last active May 17, 2024 08:05
Luhn validation algorithm
/**
* Luhn algorithm in JavaScript: validate credit card number supplied as string of numbers
* @author ShirtlessKirk. Copyright (c) 2012.
* @license WTFPL (http://www.wtfpl.net/txt/copying)
*/
var luhnChk = (function (arr) {
return function (ccNum) {
var
len = ccNum.length,
bit = 1,
@endJunction
endJunction / config.xml
Created November 7, 2012 11:08
boost::property_tree and xml config example
<coupling>
<P algorithm="serial">
<M name="flow1" type="GROUNDWATER_FLOW" />
<P algorithm="parallel">
<M name="compoundA" type="MASS_TRANSPORT" />
<M name="compoundB" type="MASS_TRANSPORT" />
</P>
</P>
</coupling>
@robmiller
robmiller / .gitconfig
Created July 17, 2013 07:52
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"