Skip to content

Instantly share code, notes, and snippets.

View zapatoche's full-sized avatar

Yannick Schall zapatoche

  • Bish Bash Bosh it
  • London, UK
View GitHub Profile
@zapatoche
zapatoche / ID.js
Created December 16, 2020 00:46
ID - a unique ID/name generator for JavaScript
// Generate unique IDs for use as pseudo-private/protected names.
// Similar in concept to
// <http://wiki.ecmascript.org/doku.php?id=strawman:names>.
//
// The goals of this function are twofold:
//
// * Provide a way to generate a string guaranteed to be unique when compared
// to other strings generated by this function.
// * Make the string complex enough that it is highly unlikely to be
// accidentally duplicated by hand (this is key if you're using `ID`
<div class="mvf-intro-text"></div>
@zapatoche
zapatoche / html-languages.txt
Created June 1, 2017 16:25 — forked from JamieMason/html-languages.txt
HTML lang attribute / ISO language code reference / Culture names
CULTURE SPEC.CULTURE ENGLISH NAME
--------------------------------------------------------------
Invariant Language (Invariant Country)
af af-ZA Afrikaans
af-ZA af-ZA Afrikaans (South Africa)
ar ar-SA Arabic
ar-AE ar-AE Arabic (U.A.E.)
ar-BH ar-BH Arabic (Bahrain)
ar-DZ ar-DZ Arabic (Algeria)
ar-EG ar-EG Arabic (Egypt)
@zapatoche
zapatoche / development-setup-el-capitan
Created October 4, 2016 12:19 — forked from ilkovich/development-setup-el-capitan
Installing NGINX+PHP+MYSQL+DNSMASQ+NVM+NODE+NPM in OSX "El Capitan"
#!bash
# Removing apache from autostart
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
brew tap homebrew/services
# Installing NGINX
brew install nginx
# Adding NGINX to autostart
sudo cp /usr/local/opt/nginx/*.plist /Library/LaunchAgents
// I tried to create a shared less task that can be run between the live-reload task and the browser-sync task
// It kind of work (not) but the browser reload and reconnect all of the time
var gulp = require('gulp');
var less = require('gulp-less');
var watch = require('gulp-watch');
var plumber = require('gulp-plumber');
var path = require('path');
var postcss = require('gulp-postcss');
var autoprefixer = require('autoprefixer-core');
// strip-units required by spread mixin
// http://stackoverflow.com/questions/12328259/how-do-you-strip-the-unit-from-any-number-in-sass
@function strip-units($number)
@return $number / ($number * 0 + 1)
// pow and sqrt required by ease function
// adapted from https://github.com/at-import/Sassy-math/blob/master/sass/math.scss
@function pow($base, $exponent)
$value: $base
@zapatoche
zapatoche / SassMeister-input-HTML.haml
Created November 26, 2014 11:48
Generated by SassMeister.com.
.light-body Donec id elit non mi porta gravida at eget metus.
.dark-body Donec id elit non mi porta gravida at eget metus.
.blue-body Donec id elit non mi porta gravida at eget metus.
$(function(){
if ($('body').hasClass('mp-2376')) {
$('.mp-2376').unbind('click');
}
//only apply the bellow functionality to nodes with the following body class: mobile-optimisation
if ($('body').hasClass('mobile-optimisation')) {
$('.form-radios .form-item').click(function(){
$(this).addClass("checked").siblings('.form-item').removeClass('checked');
@zapatoche
zapatoche / gist:7470182bac86ae636807
Created August 27, 2014 16:35
sudo lsof -i | grep LISTEN
launchd 1 root 9u IPv6 0x9405e098600e584b 0t0 TCP *:afpovertcp (LISTEN)
launchd 1 root 10u IPv4 0x9405e098600e6853 0t0 TCP *:afpovertcp (LISTEN)
launchd 1 root 24u IPv6 0x9405e098600e540b 0t0 TCP *:microsoft-ds (LISTEN)
launchd 1 root 25u IPv4 0x9405e098600e606b 0t0 TCP *:microsoft-ds (LISTEN)
launchd 1 root 29u IPv6 0x9405e098600e4fcb 0t0 TCP localhost:ipp (LISTEN)
launchd 1 root 30u IPv4 0x9405e098600f4853 0t0 TCP localhost:ipp (LISTEN)
kdc 82 root 6u IPv6 0x9405e098600e4b8b 0t0 TCP *:kerberos (LISTEN)
kdc 82 root 8u IPv4 0x9405e09861b5906b 0t0 TCP *:kerberos (LISTEN)
2BUA8C4S2 487 yannickschall 12u IPv4 0x9405e0987400106b 0t0 TCP localhost:6258 (LISTEN)
2BUA8C4S2 487 yannickschall 13u IPv6 0x9405e098600e474b 0t0 TCP localhost:6258 (LISTEN)
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure