Skip to content

Instantly share code, notes, and snippets.

View srn's full-sized avatar

Søren srn

View GitHub Profile
@srn
srn / gist:8c8d3ab116bcc8da7dd7
Created September 8, 2015 14:43
keybase.md
### Keybase proof
I hereby claim:
* I am srn on github.
* I am srn (https://keybase.io/srn) on keybase.
* I have a public key whose fingerprint is 0D92 20CC C6B3 0FCA 4DC8 FFFC EA4A A6FF 21BD ED56
To claim this, I am signing this object:
TN:
SF:/Users/srn/dev/js/node/srn-js/node_modules/istanbul-instrumenter-loader/index.js!/Users/srn/dev/js/node/srn-js/node_modules/jsx-loader/index.js?insertPragma=React.DOM!/Users/srn/dev/js/node/srn-js/client/components/NotFound.jsx
FN:5,(anonymous_1)
FNF:1
FNH:1
FNDA:1,(anonymous_1)
DA:1,1
DA:3,1
DA:6,1
DA:18,1
TN:
SF:/Users/srn/dev/js/node/srn-js/client/components/NotFound.jsx
FN:5,(anonymous_1)
FNF:1
FNH:1
FNDA:1,(anonymous_1)
DA:1,1
DA:3,1
DA:6,1
DA:18,1
// visit: just-eat.dk/member/prevorders
var sum = 0;
$('#ctl00_ContentPlaceHolder1_rightbox table tbody tr').each(function(){
var amount = parseInt($(this).find('td').eq(3).find('div').find('div').eq(0).text().replace(',00', ''), 10);
console.log(amount);
if (isNaN(amount)) { return }
sum += amount;
})
String.prototype.format = function () {
var formatted = this;
for (var i = 0; i < arguments.length; i++) {
formatted = formatted.replace(
RegExp('\\{' + i + '\\}', 'g'), arguments[i]);
}
return formatted;
};
@srn
srn / todo
Created January 8, 2012 08:07
export TODO=~/Dropbox/todo
function todo() { if [ $# == "0" ]; then cat $TODO; else n=$(($(tail -1 $TODO | cut -d ' ' -f 1)+1)); echo "$n ⇾ $@" >> $TODO; fi }
function todone() { sed -i -e "/^$*/d" $TODO; }
public class ConfigurationBuilder
{
private const string APP_CONFIG_KEY = "CONNECTIONSTRING";
private const string EDMX_PATH = "OpenTrackerEntities";
public static string BuildConnectionString()
{
if (string.IsNullOrEmpty(ConfigurationManager.AppSettings[APP_CONFIG_KEY]))
throw new ConfigurationErrorsException(APP_CONFIG_KEY + " was not found in Application Settings");
public class OpenTrackerContext
{
public static string ConnectionString = string.Empty;
private const string APP_CONFIG_KEY = "CONNECTIONSTRING";
private const string EDMX_PATH = "OpenTrackerEntities";
static OpenTrackerContext()
{
if (string.IsNullOrEmpty(ConfigurationManager.AppSettings[APP_CONFIG_KEY]))