Skip to content

Instantly share code, notes, and snippets.

@s992
s992 / app.js
Last active August 29, 2015 14:07
Rate limiting
(function() {
"use strict";
angular.module( "myApp", [
"rateLimiter"
])
.config([ "rateLimiterConfigProvider", function( rateLimiterConfigProvider ) {
rateLimiterConfigProvider.addLimiter( /api\.battle\.net/, 10, 1100 );
}])
@s992
s992 / post-merge
Created April 21, 2017 05:37 — forked from hultberg/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@s992
s992 / keybase.md
Last active April 16, 2022 02:28
keybase.md

Keybase proof

I hereby claim:

  • I am s992 on github.
  • I am seanw_ (https://keybase.io/seanw_) on keybase.
  • I have a public key ASAXfjoSHNL42_cgoIS5smI-jenxdU0weKyHqDBd6yYaTwo

To claim this, I am signing this object: