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
// This is useful for a few things: | |
// | |
// 1. Checking what dictionary options are supported by some platform API. | |
// 2. Debugging mysterious cases where an object you pass as input to another | |
// API doesn’t seem to get treated the way you’re expecting. | |
// 3. When designing another Proxy’s handler implementation, verifying that you | |
// are accounting for everything correctly and that the intended abstraction | |
// isn’t leaking in quirky ways. | |
// | |
// ex: |
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/bash | |
MAIN=${1:-develop} | |
BRANCHES=$(git branch --merged $MAIN | grep -v -e 'master\|staging\|develop\|\*') | |
echo Branches merged into $MAIN: | |
echo $BRANCHES | |
read -p "Delete these branches (y/n)? " answer |
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
express = require("express") | |
fs = require('fs') | |
https = require('https') | |
httpProxy = require('http-proxy') | |
path = require('path') | |
# where do you want to see our stuff? site must use bootstrap 3!! | |
#HOST = "http://getbootstrap.com" | |
HOST = "https://hourlynerd.com" |
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
// Safari, in Private Browsing Mode, looks like it supports localStorage but all calls to setItem | |
// throw QuotaExceededError. We're going to detect this and just silently drop any calls to setItem | |
// to avoid the entire page breaking, without having to do a check at each usage of Storage. | |
if (typeof localStorage === 'object') { | |
try { | |
localStorage.setItem('localStorage', 1); | |
localStorage.removeItem('localStorage'); | |
} catch (e) { | |
Storage.prototype._setItem = Storage.prototype.setItem; | |
Storage.prototype.setItem = function() {}; |
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
circularIndex = (idx, len) -> | |
return ((idx % len) + len) % len |
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
/* | |
this hack fixes the following issues: | |
https://github.com/taptapship/wiredep/issues/149 | |
https://github.com/taptapship/wiredep/issues/183 | |
be aware that: | |
- this will take overrides from everything in your BOWER_PATH, | |
even packages that you might not depend on | |
- overrides in your bower.json win |
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
{% autoescape false %} | |
(function(){ | |
var ruleMap = {{ rule_map }}; | |
X = X || {}; | |
X.url_for = function(endpoint, params) { | |
var re = /\<\s*(\w+:)*(\w+)\s*\>/ig; | |
if (!params) { | |
params = {}; | |
} |
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
## | |
# Open a confirmation dialog with 2 buttons (ok, cancel) and a question, and an optional title | |
# | |
# use: $modal = X.dialog({body: "Are you sure?", primary: "OK", secondary: "Cancel", title: null}, function(primaryClicked){ | |
# var $button = this; // 'this' is the jquery obj of the button that was clicked | |
# }); //the function returns the modal that was just shown so that you can modify it | |
# | |
# arguments (square brackets around type means that it is optional): | |
# opts = [object] | |
# body = [string] (default: 'Are you sure?' ) - the body text of the dialog |
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
"1234567890.34".replace(/\B(?=(\d{3})+(?!\d))/g, ",") | |
"1,234,567,890.34" |
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
// ==UserScript== | |
// @name Catman OpenPediatrics Login | |
// @namespace dogself | |
// @version 0.1 | |
// @description log in like catman | |
// @include https://hq.app.openpediatrics.org/webUI | |
// @include https://hq.app.openpediatrics.org/webUI/ | |
// @grant unsafeWindow | |
// @run-at document-end | |
// @copyright dogself |
NewerOlder