Skip to content

Instantly share code, notes, and snippets.

@emilbayes
emilbayes / gist:3758113
Created September 20, 2012 20:20
Map data - Denmark
{
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "properties": { "UUID": "til fremtidig brug", "FEAT_ID": 24954101, "DAGI_ID": 389119, "FEAT_KODE": "6310", "SUB_KODE": 3, "FEAT_TYPE": "Kommune", "FEAT_STTXT": "Taget i brug", "GEOM_STTXT": "Endelig", "AREAL": 66.01, "KOMKODE": "0185", "KOMNAVN": "Tårnby", "REGIONKODE": "1084", "REGIONNAVN": "Region Hovedstaden", "GYLDIG_FRA": null, "GYLDIG_TIL": null, "DQ_SPECIFK": "DS_DAGI_v1.0_2M", "DQ_STATEM": "Generaliseret, ca. 1:2 mill", "DQ_DESCR": "Autogenereret, kontrolleret", "DQ_PROCESS": "Kort og Matrikelstyrelsen", "DQ_RESPONS": "Indenrigs- og Socialministeriet", "DQ_POSACPL": "500", "DQ_POSACLV": "", "TIMEOF_CRE": "2009\/06\/02", "TIMEOF_PUB": "2009\/06\/03", "TIMEOF_REV": null, "TIMEOF_UDT": "2012\/07\/15" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 735376.0, 6171038.0 ], [ 735321.0, 6170990.0 ], [ 735321.0, 6170916.0 ], [ 735411.0, 6170940.0 ], [ 73540
@emilbayes
emilbayes / AcyclicGraph.coffee
Created September 26, 2012 14:42
Acyclic Graphs for PGM Course
class window.AcyclicGraph
color: d3.scale.category20()
constructor: (width, height, elm, data) ->
@svg = d3.select(elm).append("svg")
.attr("width", width)
.attr("height", height)
@defineArrowMarker()
@emilbayes
emilbayes / TimedHashTable.coffee
Created November 18, 2012 18:26
Timed Hash Table
class TimedHashTable
table: {}
timers: {}
size: 0
constructor: (@defaultTimeout) ->
get: (hash) ->
@table[hash]
@emilbayes
emilbayes / MiddlewareStack.coffee
Created November 26, 2012 20:40
Middleware Stack
`
Object.isObject = function(_obj) {
var _test = _obj;
return ( typeof _obj !== 'object' || _obj === null ?
false :
(
(function () {
while (!false) {
if ( Object.getPrototypeOf( _test = Object.getPrototypeOf(_test) ) === null) {
break;
@emilbayes
emilbayes / Streaming_Videolectures.net.js
Created December 28, 2012 16:32
Snippet to get streaming url of current Videolectures.net video (for streaming with VLC/rtmpdump/ffmpeg)
javascript:(function(){alert(clip.netConnectionUrl + '/' + window.location.href.match(/([^ \/]*)\/$/)[1] + '/' + clip.url + '/');})()
Use https://gist.github.com/emilbayes/a7ba78bf40f128ce2da1
This file has been truncated, but you can view the full file.
{"delete":{"status":{"id":314064358093230081,"user_id":1260845234,"id_str":"314064358093230081","user_id_str":"1260845234"}}}
{"created_at":"Sat May 11 15:09:05 +0000 2013","id":333237331186298881,"id_str":"333237331186298881","text":"\ud83d\ude1c\ud83d\ude1c:) http:\/\/t.co\/ltwrQNFPfB","source":"\u003ca href=\"http:\/\/instagram.com\" rel=\"nofollow\"\u003eInstagram\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":206638217,"id_str":"206638217","name":"Laah ","screen_name":"mordo_cuidado","location":"","url":null,"description":"Saudades @juuulucila_ Ciumenta @GiGarciaAugust","protected":false,"followers_count":24,"friends_count":38,"listed_count":0,"created_at":"Sat Oct 23 11:39:36 +0000 2010","favourites_count":5,"utc_offset":-10800,"time_zone":"Brasilia","geo_enabled":false,"verified":false,"statuses_count":361,"lang":"pt","contributors_enabled":false,"is_tr
@emilbayes
emilbayes / coverElement.js
Created February 16, 2014 10:36
Make one element cover another proportionately
(function($) {
$.fn.extend({
coverElement: function(options) {
var settings = $.extend(true, {
container: 'html' //Default is fit the viewport
}, options);
var $elements = this,
$container = this.first().closest(settings.container);
@emilbayes
emilbayes / Docs.md
Created June 19, 2014 13:59
Convert images to video slideshow

Folder structure

|-/input #Still images
|-/frames #Converted and resized frames
|-/output

|- video.mp4

@emilbayes
emilbayes / index.css
Created August 26, 2014 12:05
Semantic CSS Arrow
body {
width: 360px;
}
.box {
width: 100%;
}
.box header {
background: #ddd;