Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Carlsen tcarlsen

  • Ekstra Bladet
  • Copenhagen, Denmark
View GitHub Profile
View home.ts
import {Component, View} from 'angular2/angular2';
import {Http, httpInjectables} from 'angular2/http';
@Component({
selector: 'home',
appInjector: [
httpInjectables
]
})
View server.js
'use strict';
var gulp = require('gulp');
var connect = require('gulp-connect');
var modRewrite = require('connect-modrewrite');
// Rewriting rule for clean urls
var middleware = [
modRewrite([
'!\\.\\w+$ /index.html [L]',
View gist:39506c6fd84f42c25d61
<link rel="stylesheet" href="/path/to/flipclock.css">
<style>
.cd-container {
display: inline-block;
}
</style>
<div class="cd-container">
<div class="countdown"></div>
</div>
<script src="/path/to/flipclock.min.js"></script>
@tcarlsen
tcarlsen / repeat-finished.coffee
Created Jan 19, 2015
fire function after ngRepeat is done in Angularjs
View repeat-finished.coffee
angular.module "onFinishRenderDirective", []
.directive "onFinishRender", ($timeout) ->
restrict: "A"
link: (scope, element, attr) ->
if scope.$last
$timeout -> scope.$emit "ngRepeatFinished"
@tcarlsen
tcarlsen / untitled
Created Nov 25, 2014
Anders lorte ged død duktion
View untitled
youDie = function () {
var goatPos = $("#goat").offset()
var pooPos = $("#poo").offset()
if (goatPos.x === pooPos.x and goatPos.y === pooPos.y) {
alert("you fucking died!");
}
}
View segregation-chart.coffee
label
.text data.label
.style 'font-size', "24px"
.style "font-size", ->
r = innerRadius - 20
return (2 * r) / this.getComputedTextLength() * 24 + "px"
@tcarlsen
tcarlsen / Todo.md
Last active Aug 29, 2015
My Berlingske ToDo list
View Todo.md
View keybase.md

Keybase proof

I hereby claim:

  • I am tcarlsen on github.
  • I am tcarlsen (https://keybase.io/tcarlsen) on keybase.
  • I have a public key whose fingerprint is AF53 4F20 8D65 F19E 28AF 062A 3346 CDE8 75A2 9895

To claim this, I am signing this object:

@tcarlsen
tcarlsen / untitled
Created Aug 26, 2014
gallup vælgervandring struktur
View untitled
{
"A": {
"B": {
"afgang": 20000,
"tilgang": 343432,
"netto": 32423
},
"C": {
...
}
@tcarlsen
tcarlsen / dynamic-iframe.js
Created Jul 7, 2014
Dynamic iFrame height
View dynamic-iframe.js
function updateIframeSize() {
$('iframe.dynamic').height(window.innerHeight - ($('.header').height())).width("100%");
}
updateIframeSize();