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 / Middleware-CSP.php
Created May 1, 2023 08:24 — forked from valorin/Middleware-CSP.php
CSP Middleware - the simple CSP middleware I use across all of my projects.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Vite;
use Illuminate\Support\Str;
/**
* Simple Content Security Policy middleware.
@juukie
juukie / download.js
Created December 3, 2021 11:31 — forked from maryo/download.js
Typekit font downloader
const https = require('https');
const fs = require('fs');
// https://github.com/majodev/google-webfonts-helper/blob/master/server/logic/conf.js
const FORMAT_USER_AGENTS = {
// see http://www.dvdprojekt.de/category.php?name=Safari for a list of sample user handlers
// test generation through running grunt mochaTest:src
eot: 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)',
woff: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0',
// must serve complete woff2 file for one variant (no unicode range support yet!)
@juukie
juukie / JsColor.vue
Created September 8, 2021 11:26 — forked from niveshsaharan/JsColor.vue
Vue.js Component for http://jscolor.com/
<template>
<div class="input-control color-input">
<input :value="value"
:id="id"
class="jscolor-input {hash:true,styleElement:'',onFineChange:'jsColorOnFineChange(this)'}"
@change="onChange($event.target)"
@input="onChange($event.target)"
@focus="showColorPicker"
@onFineChange="onFineChange"
ref="color_input"
@juukie
juukie / package.json.js
Created November 20, 2020 14:50 — forked from MoOx/package.json.js
Boost your Webpack performance with DLLPlugin (will bundle as dll all your "dependencies", see comment in package.json)
{
"private": true,
// ...
"#dependencies": "dependencies are the one shipped to the client",
"dependencies": {
"babel-polyfill": "^6.7.4",
"react": "^15.0.0",
// ...
"whatwg-fetch": "^0.11.1"
},
@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 })
)
}
import React from 'react-native'
var {
Image,
Animated,
View
} = React
module.exports = React.createClass({
getInitialState() {
@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
@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);