Skip to content

Instantly share code, notes, and snippets.

View phacks's full-sized avatar
🤓
Eager to learn

Nicolas Goutay phacks

🤓
Eager to learn
View GitHub Profile
@phacks
phacks / alpine-csp-limitations.md
Last active February 10, 2024 10:05
Alpine CSP limitations

Alpine CSP limitations

Passing parameters to functions

The following test fails with the CSP build:

test.csp('event object is not passed if other params are present',
    [html`
 
/* InstantClick 3.1.0 | (C) 2014-2017 Alexandre Dieulot | http://instantclick.io/license */
var instantclick,
InstantClick = (instantclick = (function(document, location, $userAgent) {
// Internal variables
var $currentLocationWithoutHash,
$urlToPreload,
$preloadTimer,
$lastTouchTimestamp,
$hasBeenInitialized,
@phacks
phacks / shadows.js
Created September 5, 2019 12:02
Material UI override shadows with color
/**
* This module is used at providing an easy way to override material-ui
* `shadows` properties.
* material-ui expects the shadows to be following a certain pattern.
* (source: https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/styles/shadows.js)
* This file is a slight adaptation (for colours) of the above material-ui source file.
*
* This module exports a `createShadows(hexColor: string): Array<string>` method
* that takes a hex color (presumably from the configuration) and returns an array
* of the 25 possible shadows matching the 25 elevations in material-ui.
@phacks
phacks / sortObjectByValues.js
Created February 20, 2019 14:51
sortObjectByValues
import toPairs from 'lodash/fp/toPairs';
import fromPairs from 'lodash/fp/fromPairs';
import sortBy from 'lodash/fp/sortBy';
import flow from 'lodash/fp/flow';
/**
* Returns the object, sorted by the lexicographical order of its values
*
* Equivalent to
* _(object).toPairs().sortBy(1).fromPairs().value()
@phacks
phacks / performance-audit.md
Created January 25, 2018 21:38
Theodo Performance Audit
@phacks
phacks / .zpreztorc
Last active August 29, 2015 14:15
.zpreztorc
#
# Sets Prezto options.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# General
#
@phacks
phacks / init.zsh
Last active August 29, 2015 14:15
init.zs
#
# Initializes Prezto.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# Version Check
#
@phacks
phacks / .tmux.conf
Last active February 6, 2017 10:46
tmux.conf
# Set reload key to r
bind r source-file ~/.tmux.conf
# use UTF8
set -g utf8
set-window-option -g utf8 on
# set Ctrl-a as the default prefix key combination and unbind C-b to free it up
set -g prefix C-a
unbind C-b
@phacks
phacks / .vimrc
Last active August 29, 2015 14:13
vimrc
"""""""""""""""""""""""""""""""""""""""""""""""""""""
" ___/PLUGINS\___
"""""""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible " be iMproved, required
filetype plugin on " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins