This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package "redis-server" | |
ruby_block "redis-conf" do | |
block do | |
filename = "/etc/redis/redis.conf" | |
if File::exists?(filename) | |
redisConf = File.read(filename) | |
redisConf = redisConf.gsub(/bind .*/, "bind 0.0.0.0") | |
File.open(filename, 'w') {|f| f.write(redisConf) } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The MIT License (MIT) | |
Copyright (c) 2014 Quoc Le <[email protected]> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PROJDIR=`cd ..;pwd` | |
PROJECT_BUILDDIR="${PROJDIR}/build/Release-iphoneos" | |
DEVELOPPER_NAME="iPhone Distribution" | |
APPLICATION_NAME=SomeAppName | |
IPA_NAME=${APPLICATION_NAME}.ipa | |
# compile project | |
echo Building Project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sum.py | |
# | |
# Sums up a specific column in a csv, input is via PIPE | |
# Useful for piping multiple files in at once. | |
import sys | |
import csv | |
if len(sys.argv) < 2: | |
print "Usage: cat file | python sum.py column#" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import the necessary packages | |
import argparse | |
import cv2 | |
import numpy as np | |
import math | |
# initialize the list of reference points and boolean indicating | |
# whether cropping is being performed or not | |
refPt = [] | |
cropping = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config setup | |
cachecrls=yes | |
uniqueids=yes | |
conn ios | |
keyexchange=ikev1 | |
authby=xauthpsk | |
xauth=server | |
left=%defaultroute | |
leftsubnet=0.0.0.0/0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// converts 3 hex into 6 hex | |
function normalizeHex(hex) { | |
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; | |
hex = hex.replace(shorthandRegex, function(m, r, g, b) { | |
return '#' + r + r + g + g + b + b; | |
}); | |
return hex; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
# Copyright (C) 2016 Sixten Bergman | |
# License WTFPL | |
# | |
# This program is free software. It comes without any warranty, to the extent | |
# permitted by applicable law. | |
# You can redistribute it and/or modify it under the terms of the Do What The | |
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --- !Ups | |
CREATE FUNCTION first_agg(anyelement, anyelement) RETURNS anyelement | |
LANGUAGE SQL IMMUTABLE STRICT | |
AS $_$ SELECT $1 $_$; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const serverHash = "d280d20edc8da0944f9893fe4e8e3b2010d197ef19f83856ebdd930866d54d04"; | |
const clientSeed = "732d81dc27d5fa9d"; | |
var nonce = 3000; | |
const roll_prime_dice = function (key, text) { | |
// create HMAC using server seed as key and client seed as message | |
const hash = crypto | |
.createHmac('sha512', key) | |
.update(text) |
OlderNewer