Skip to content

Instantly share code, notes, and snippets.

View SindreSvendby's full-sized avatar

Sindre Svendby SindreSvendby

  • Oslo, Norway
  • 10:45 (UTC +01:00)
View GitHub Profile
.DS_Store
Gemfile.lock
*.pem
node.json
tmp/*
!tmp/.gitignore
.DS_Store
Gemfile.lock
*.pem
node.json
tmp/*
!tmp/.gitignore
<!DOCTYPE html>
<html>
<head>
<script src="http://static.jsbin.com/js/vendor/traceur.js"></script>
</head>
<body>
<canvas id="court" width="400" height="800" style="border:1px solid #000000;"></canvas>
<script id="jsbin-javascript">
/*
// Dumps all headers
// My usages is to test what headers Cloudfront is setting. Used together with ngrok for me.
//start script:
// npm install
// node headers.js
var express = require('express');
var app = express();
@SindreSvendby
SindreSvendby / ceadar-test.js
Created October 14, 2015 21:39
Test to check if some of the apps I have is on the old cedar platform in heroku
// The legacy Cedar-10 stack has been deprecated and will reach its end-of-life on November 4, 2015.
// To see if some of your apps is old;
// HEROKU_API_TOKEN="<YOUR_HEROKU_TOKEN_HERE>" node ceadar-test.js
const Heroku = require('heroku-client');
const hl = require('highland');
var hk = new Heroku({
token: process.env.HEROKU_API_TOKEN
});
@SindreSvendby
SindreSvendby / removeLogentires.sh
Created November 30, 2015 16:52
remove all logentries drains setup in heroku.
#!/bin/bash
for app in `heroku list | grep [a-z] | cut -d " " -f 1`; do
for logDrains in `heroku drains -a $app 2>/dev/null | grep ^syslog`; do
if [[ $logDrains == *"logentries"* ]]; then
echo "`heroku drains:remove $logDrains -a $app` for $app";
else
echo "Skipping $logDrains"
fi
done
@SindreSvendby
SindreSvendby / .i3config
Created December 4, 2015 09:27
My i3 config
xrandr --output DP1 --auto --left-of LVDS1
# Send in urls as arguments, this
# script will loop over the arguments and do 100 request to each url
# it will report the Average time to first byte for each site.
LOOP=100;
for SITE in "$@"
do
echo "Requesting $SITE $LOOP times ...";
SUM=0;
for i in $(seq 1 $LOOP)
do
@SindreSvendby
SindreSvendby / performance.now()-polyfill.js
Last active July 8, 2016 11:00 — forked from paulirish/performance.now()-polyfill.js
performance.now() polyfill (aka perf.now())
// @license http://opensource.org/licenses/MIT
// copyright Paul Irish 2015
// Date.now() is supported everywhere except IE8. For IE8 we use the Date.now polyfill
// github.com/Financial-Times/polyfill-service/blob/master/polyfills/Date.now/polyfill.js
// as Safari 6 doesn't have support for NavigationTiming, we use a Date.now() timestamp for relative values
// if you want values similar to what you'd get with real perf.now, place this towards the head of the page
// but in reality, you're just getting the delta between now() calls, so it's not terribly important where it's placed
@SindreSvendby
SindreSvendby / performance.now.polyfill.js
Created July 8, 2016 10:52 — forked from yesasha/performance.now.polyfill.js
performance.now() and performance.timing.navigationStart polyfill
// performance.now() and performance.timing.navigationStart polyfill
if (!window.performance) {
window.performance = {};
}
if (!performance.now) {
performance.now = function () {
return Date.now() - this.timing.navigationStart;
}
}