Skip to content

Instantly share code, notes, and snippets.

View edsykes's full-sized avatar

Ed Sykes edsykes

View GitHub Profile
@edsykes
edsykes / gist:10993341
Created April 17, 2014 15:46
bootstrap 3 carousel step specific animations
$(document).ready(function() {
var timings = [6000, 4000, 4000, 4000, 4000, 4000];
var index = 0;
var animate = true;
var nextAnimation = function(timings) {
if (animate) {
$('.right.carousel-control').click();
}
@edsykes
edsykes / bootstrap3-carousel-animation-custom
Last active August 29, 2015 13:59
bootstrap 3 carousel step specific animations
@edsykes
edsykes / gist:f8e309a06e21b7d63965
Created August 19, 2014 16:22
quantified dev api using curl.
stream=$(curl -x localhost:8888 -X POST http://app.quantifieddev.org/stream)
id=$(echo $stream | sed 's_.*"streamid": "\([^"]*\)".*_\1_')
read=$(echo $stream | sed 's_.*"readToken": "\([^"]*\)".*_\1_')
write=$(echo $stream | sed 's_.*"writeToken": "\([^"]*\)".*_\1_')
curl -k -x localhost:8888 -X POST -H Content-Type:application/json -H Authorization:$write -H Cache-Control:no-cache -d '{ "dateTime": "2014-03-31T15:28:36.1788806Z", "location": { "lat": 52.5203, "long": 0.8567 }, "actionTags": [ "Build", "Start" ], "objectTags": [ "Computer", "Software" ], "properties": { "Language": "C#", "Environment": "VisualStudio2012" } }' http://app.quantifieddev.org/stream/$id/event
echo register this stream at http://app.quantifieddev.org/dashboard?streamId=$id\&readToken=$read
Verifying that +edsykes is my openname (Bitcoin username). https://onename.io/edsykes
@edsykes
edsykes / gist:e9d29c1d9bbfa983376b
Created November 26, 2014 22:42
Simple SVG flood example
<svg>
<defs>
<filter id="flood-1">
<feFlood x="30" y="30" width="30" height="30" flood-color="#00f" result="flood"/>
</filter>
</defs>
<circle cx="50" cy="50" r="50" fill="#0f0" filter="url(#flood-1)" />
</svg>
@edsykes
edsykes / gist:ab6365d7d595846be564
Last active August 29, 2015 14:10
nice blur effect
<filter x="-50%" y="-50%" id="drop-shadow" height="250%" width="380%">
<feGaussianBlur in="SourceAlpha" stdDeviation="10" result="blur"></feGaussianBlur>
<feOffset in="blur" dx="0" dy="0" result="offsetBlur"></feOffset>
<feMerge>
<feMergeNode in="offsetBlur"></feMergeNode>
<feMergeNode in="SourceGraphic"></feMergeNode>
</feMerge>
</filter>
@edsykes
edsykes / gist:a422ec420558879a2f42
Created November 27, 2014 01:04
better shadow when you have alpha in source image
<filter x="-70%" y="-50%" id="drop-shadow" height="250%" width="380%">
&gt;<feComponentTransfer xmlns="http://www.w3.org/2000/svg">
<feFuncA type="linear" slope="10.7"></feFuncA><feFuncR type="linear" slope="-10"></feFuncR>
<feFuncG type="linear" slope="0">
</feFuncG>
<feFuncB type="linear" slope="0"></feFuncB>
</feComponentTransfer>
<feGaussianBlur stdDeviation="15"></feGaussianBlur>
@edsykes
edsykes / gist:04fe7951a7e08fcec417
Created June 5, 2015 17:05
find the index where a value would be inserted in a reverse sorted array
var reverseSortedIndex = function(array, value, predicate){
var result = -1;
var low = 0;
var high = array.length;
var current = 0;
var search = value;
while(low < high){
// uncomment these lines if you want to see how this algorithm works
//console.log('');
@edsykes
edsykes / gist:8ebcbf93588277eb4f40
Created June 10, 2015 15:28
kill all processes listening to 5900-5909
lsof | grep "590.* (LISTEN)" | cut -c 12-16 | uniq | kill $(xargs)
@edsykes
edsykes / gist:c82e1a54a8ccbde06ec9
Created July 21, 2015 16:18
kill all java processes running on port 9000
lsof -i -n -P | grep "java.*9000" | cut -c 11-16 | uniq | kill $(xargs)