Skip to content

Instantly share code, notes, and snippets.

View tdwesten's full-sized avatar

Thomas van der Westen tdwesten

View GitHub Profile
@tdwesten
tdwesten / Gulp.js
Last active January 12, 2020 05:37
Extract glyphs from a font and build a icon-font with gulp
var opentype = require( 'opentype.js' );
var fs = require( 'fs' );
var _ = require( 'lodash' );
gulp.task( 'icons', function() {
var icons = [];
var scss = '[class^="my-icon-"], [class*=" my-icon-"] { display: inline-block; font: normal normal normal 14px/1 "mylaps-icons"; font-size: inherit; text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }';
opentype.load( manifest.dependencies.icons.font[ 0 ], function( err, font ) {
# initialization file (not found)
// Start MongoDB
sudo /etc/init.d/mongod start
// Stop MongoDB
sudo /etc/init.d/mongod stop
// Start Naught node worker
naught start --worker-count 1 server.js
// Stop Naught node worker
@tdwesten
tdwesten / gist:94cbd01016a360c756a0
Created February 12, 2015 15:14
Disable BR tag's for inline content
div br {
display: none;
}
@tdwesten
tdwesten / gist:d8a3c7760b836e6d4bce
Last active August 29, 2015 14:10
node request
// Ik probeer mijn betaande thermo-settings te updaten met de onderstaande variable "settings".
// Maar het lukt mij niet om de nieuwe data door te sturen..
// request
var setting = {
_id: 546fb9f13a9b3e00002a8e77,
temp_tracking: true,
last_update: Fri Nov 28 2014 08:25:32 GMT+0100 (CET),
current_schedule: [
{ _id: '5479a35fc6eacfc1e38bd786',
@tdwesten
tdwesten / gist:346f14763237316e424e
Created November 27, 2014 10:38
nodejs request
var FS = require('fs'),
request = require('request');
function getResults(pathToFile, callback) {
FS.readFile(pathToFile, 'utf8', function(err, data) {
if (err) return callback(err);
var response1, response2;
request.post('http://service1.example.com?data=' + data), function(err, response, body) {
if(err) return callback(err);
// mixin for easy focus color removement
@mixin remove-focus-color {
outline: none;
-webkit-tap-highlight-color: rgba(255, 255, 255, 0); /* mobile webkit */
}
@tdwesten
tdwesten / _menu-list.scss
Created November 6, 2014 07:53
Styling unordered lists as horizontal menu's via SCSS Mixin
@mixin menu_list{
ul { list-style-type: none; }
li { float: left; }
}
@tdwesten
tdwesten / _ellipsis-mixin.scss
Last active August 29, 2015 14:08 — forked from pixelchar/ellipsis-mixin.scss
Add "..." to overflowd'ing content via SCSS mixin
@mixin ellipsis() {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
@tdwesten
tdwesten / _word-wrap.scss
Created November 6, 2014 07:46
Word wrap content in element via SCSS mixin
@mixin word-wrap() {
word-break: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}