Skip to content

Instantly share code, notes, and snippets.

View thomd's full-sized avatar

Thomas Dürr thomd

  • Hamburg, Germany
View GitHub Profile
@thomd
thomd / .scss-lint.yml
Created April 17, 2015 18:32
exemplary scss-lint configuration
# This is the lint file for .scss files (https://github.com/causes/scss-lint)
#
# default configuration:
# https://github.com/causes/scss-lint/blob/master/config/default.yml
linters:
BangFormat:
enabled: true
space_before_bang: true
space_after_bang: false
@thomd
thomd / .csscomb.json
Created March 5, 2015 23:08
csscomb.com configuration
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": "\t",
"color-shorthand": true,
"element-case": "lower",
"leading-zero": true,
"quotes": "single",
"sort-order-fallback": "abc",
@thomd
thomd / image-server.js
Created February 17, 2015 20:20
simple image server
// EXAMPLE
// curl localhost:8080/image.png/400
//
var http = require('http');
var spawn = require('child_process').spawn;
http.createServer(function(req, res) {
var params = req.url.split('/');
var path = __dirname + '/' + params[1];
var size = params[2];
@thomd
thomd / fs_write_read.js
Created February 11, 2015 22:55
escape from callback hell in node.js
var fs = require('fs');
var path = require('path');
var dir = path.join(__dirname, 'temp');
var source = __filename;
var target = path.join(dir, 'target');
fs.mkdir(dir, handlingError(mkdired));
function mkdired() {
fs.readFile(source, handlingError(haveFile));
@thomd
thomd / race.js
Created January 25, 2015 23:09
an example for functional programming
// a functional race game
race({
time: 100,
positions: [1,1,1,1,1]
});
function race(state){
draw(state);
if(state.time){
@thomd
thomd / test.js
Created October 20, 2014 22:14
ajax spy with mocha and sinon
var assert = require('assert')
var sinon = require('sinon');
var window = require('jsdom').jsdom().parentWindow
var jquery = require('jquery')(window);
describe('jquery.ajax', function() {
before(function() {
sinon.spy(jquery, 'ajax')
});
@thomd
thomd / index.html
Last active August 29, 2015 14:06
SASS Transition
<a class="transition" href="#">foobar</a>
@thomd
thomd / index.html
Last active August 29, 2015 14:06
Responsive WebDesign - Elastic Video
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="./style.css">
<title>elastic video</title>
</head>
<body>
@thomd
thomd / ui-components.md
Last active September 30, 2021 13:14
UI Components #list #ui #components
@thomd
thomd / server.js
Created August 23, 2014 17:28
Serve local files via HTTP
// A simple static file server for development use.
var express = require('express'),
app = express();
app.use('/', express.static(__dirname));
app.listen('8000');