Skip to content

Instantly share code, notes, and snippets.

View juukie's full-sized avatar

Jürgen juukie

  • Active Creations
  • Netherlands
View GitHub Profile
@juukie
juukie / takeAtLeast.js
Created October 5, 2017 07:16
Promise takeAtLeast
// Add takeAtLeast method to Promise
/* eslint no-unused-vars: 0 */
Promise.prototype.takeAtLeast = function (time) {
return new Promise((resolve, reject) => {
const limiter = new Promise((resolve, reject) => {
setTimeout(resolve, time);
})
Promise.all([this, limiter]).then(([response, _]) => {
resolve(response)
@juukie
juukie / keybase.md
Created November 21, 2016 22:54
keybase.md

Keybase proof

I hereby claim:

  • I am juukie on github.
  • I am juukie (https://keybase.io/juukie) on keybase.
  • I have a public key whose fingerprint is C7EF 5740 EA57 DCCD BB9A 859E 6A6F AD7A 5ED4 90A4

To claim this, I am signing this object:

@juukie
juukie / README.md
Created May 17, 2016 12:15 — forked from sj26/README.md
Run MailCatcher in the background, always, on OS X

Place me.mailcatcher.plist into ~/Library/LaunchAgents, then run launchctl load ~/Library/LaunchAgents/me.mailcatcher.plist.

If you use pow, echo 1080 > ~/.pow/mailcatcher and go to http://mailcatcher.dev, otherwise use http://localhost:1080.

Currently pow doesn't seem to pass websockets through correctly. Looking into this.

@juukie
juukie / mailcatcher-install.md
Created May 17, 2016 12:10 — forked from pitpit/mailcatcher-install.md
Install Mailcatcher on OSX
@juukie
juukie / copy.js
Created May 11, 2016 20:34 — forked from miguelmota/copy.js
Deep clone copy array with lodash.
var array = [{},{},{}];
var copy = _.map(array, _.clone);
@juukie
juukie / 100-wkhtmltoimage-special.conf
Last active March 20, 2016 11:52
CentOS verbetering font rendering voor PDF
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="font">
<edit mode="assign" name="rgba">
<const>rgb</const>
</edit>
</match>
<match target="font">
<edit mode="assign" name="hinting">
// Block Grid
// Technique adapted from Foundation 5 for Bootstrap 3.
// https://github.com/zurb/foundation/blob/f755d8704123f86c281ede0b171881e2672f150d/scss/foundation/components/_block-grid.scss
// Original LESS Version by Christopher Mitchell (https://gist.github.com/ChrisTM)
// Converted to SCSS by Rasmus Jürs (https://github.com/Jursdotme)
// https://gist.github.com/Jursdotme/67abe379d4a357233d3c
// https://gist.github.com/juukie/bcd1ef59ba6dd62ce968#file-block-grid-sass
[class*="block-grid-"]
@juukie
juukie / gist:8327427
Created January 9, 2014 00:40
Little Laravel / Symfony Translation playground
// app/lang/en/global.php
return array(
'apples' => '{0} Zero apples|one: Single apple|more: :count apples',
'beers' => '{0} Drama|Single beer|more: Cheers',
'soup' => '[-Inf,0] No soup|{1,2,5} One, two or five soups|[3,Inf] The amount of soup is :count',
);
{{-- Define all our servers --}}
@servers(['staging' => '', 'production' => ''])
@setup
{{-- The timezone your servers run in --}}
$timezone = 'Europe/Amsterdam';
{{-- The base path where your deployments are sitting --}}
$path = '/var/www/site.com/htdocs';
@juukie
juukie / gist:723dd8ff9cfa706c1d6d
Created December 18, 2014 12:24
format_filesize
<?php
if ( ! function_exists('format_filesize'))
{
/**
* Formats a filesize in a human readable way.
*
* @param int $size
* @param array $sizes
* @return string