Usage:
push # opens default editor for commit message, then pushes
push updated readme.md # commits with message "updated readme.md", then pushes
Usage:
push # opens default editor for commit message, then pushes
push updated readme.md # commits with message "updated readme.md", then pushes
Usage:
commit # opens default editor for commit message
commit updated readme.md # commits with message "updated readme.md"
// http://jsfiddle.net/dandv/47cbj/ | |
function RateLimit(fn, delay, context) { | |
var queue = [], timer = null; | |
function processQueue() { | |
var item = queue.shift(); | |
if (item) | |
fn.apply(item.context, item.arguments); | |
if (queue.length === 0) | |
clearInterval(timer), timer = null; |
curl https://gist.githubusercontent.com/lukeramsden/81e029be19a686261dda4204c8002873/raw/bff6973325b159254a3ba13c5cb9ac8fda8e382b/prepare-commit-msg.sh > ~/.git-hooks/prepare-commit-msg
chmod u+x ~/.git-hooks/prepare-commit-msg
git config --global core.hooksPath ~/.git-hooks
Uses https://github.com/alexdzyoba/tzconv to get the time.
/** | |
* Calculates shipping cost to ship X grams with EMS. | |
* @param {Range} range Range or cell containing the shipping weights. | |
* @param {Number} firstCost Cost of first interval. (Default 20.91) | |
* @param {Number} additionalCost Cost of additional intervals. (Default 6.31) | |
* @param {Number} interval Interval size. (Default 500) | |
* @return Shipping cost in USD. | |
* @customfunction | |
*/ | |
function EMS_SHIPPING(range, firstCost, additionalCost, interval) { |
day_names = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'] | |
short_day_names = list(map(lambda d: d[:3], day_names)) | |
route_names = ['Bus A', 'Bus B', 'Bus C', 'Bus D', 'Bus E', 'Bus F'] | |
supplied_data = { | |
0: { # week 1 | |
day_names[0]: [0, 0, 2, 1, -1, 0], # monday | |
day_names[1]: [0, 1, 0, 0, -1, -5], # tuesday | |
day_names[2]: [0, 0, -1, 0, -1, -5], # wednesday | |
day_names[3]: [2, 0, -1, 0, -2, -5], # thursday | |
day_names[4]: [2, 1, -2, 0, -4, -4] # friday |
I hereby claim:
To claim this, I am signing this object:
-- https://stackoverflow.com/questions/38923376/return-a-new-string-that-sorts-between-two-given-strings | |
create or replace function app_public.mid_string(prev text, next text) returns text as $$ | |
declare | |
v_p int; | |
v_n int; | |
v_pos int := 0; | |
v_str text; | |
begin | |
LOOP -- find leftmost non-matching character | |
v_p := CASE WHEN v_pos < char_length(prev) THEN ascii(substring(prev from v_pos + 1)) ELSE 96 END; |
public class DslInterpreter { | |
private final EcommerceSystem system = new EcommerceSystem(); | |
public void interpret(String script) { | |
String[] lines = script.split("\n"); | |
for (String line : lines) { | |
String[] parts = line.split(" "); | |
switch (parts[0]) { | |
case "createUser": | |
system.createUser(parts[1]); |