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 / 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 / mailcatcher-install.md
Created May 17, 2016 12:10 — forked from pitpit/mailcatcher-install.md
Install Mailcatcher on OSX
@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 / 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 / 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 / macro.php
Created November 7, 2017 08:02
Laravel social media url macro
<?php
URL::macro('social', function ($name, $replacement = '#') {
return array_get([
'facebook' => 'https://www.facebook.com/mypage/',
'instagram' => 'https://www.instagram.com/mypage/',
'pinterest' => 'https://nl.pinterest.com/mypage/',
], $name), $replacement);
});
@juukie
juukie / valet-part-2.sh
Created November 29, 2018 15:08 — forked from rcubitto/valet-part-2.sh
Configure subdomains in Laravel Valet - Part 2
cd ~/.valet/Sites
ln -s example api.example
import React from 'react-native'
var {
Image,
Animated,
View
} = React
module.exports = React.createClass({
getInitialState() {
@juukie
juukie / promise.finally.polyfill.js
Created February 27, 2019 09:49 — forked from spiralx/promise.finally.polyfill.js
Polyfill to add a finally() method to the Promise object
Promise.prototype.finally = function (callback) {
return this.then(
value => this.constructor.resolve(callback()).then(() => value),
reason => this.constructor.resolve(callback()).then(() => { throw reason })
)
}
<?php
/**
* @param $object
* @return array|string
*/
function simplexml_to_array($object) {
if (! is_object($object)) {
return $object;
}