Skip to content

Instantly share code, notes, and snippets.

View tcarlsen's full-sized avatar

Thomas Carlsen tcarlsen

  • Ekstra Bladet
  • Copenhagen, Denmark
View GitHub Profile
import {Component, View} from 'angular2/angular2';
import {Http, httpInjectables} from 'angular2/http';
@Component({
selector: 'home',
appInjector: [
httpInjectables
]
})
'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]',
<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 January 19, 2015 14:26
fire function after ngRepeat is done in Angularjs
angular.module "onFinishRenderDirective", []
.directive "onFinishRender", ($timeout) ->
restrict: "A"
link: (scope, element, attr) ->
if scope.$last
$timeout -> scope.$emit "ngRepeatFinished"
@tcarlsen
tcarlsen / untitled
Created November 25, 2014 21:37
Anders lorte ged død duktion
youDie = function () {
var goatPos = $("#goat").offset()
var pooPos = $("#poo").offset()
if (goatPos.x === pooPos.x and goatPos.y === pooPos.y) {
alert("you fucking died!");
}
}
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 August 29, 2015 14:07
My Berlingske ToDo list

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 August 26, 2014 09:42
gallup vælgervandring struktur
{
"A": {
"B": {
"afgang": 20000,
"tilgang": 343432,
"netto": 32423
},
"C": {
...
}
@tcarlsen
tcarlsen / dynamic-iframe.js
Created July 7, 2014 11:29
Dynamic iFrame height
function updateIframeSize() {
$('iframe.dynamic').height(window.innerHeight - ($('.header').height())).width("100%");
}
updateIframeSize();