Skip to content

Instantly share code, notes, and snippets.

View charleslouis's full-sized avatar

okcharlo charleslouis

View GitHub Profile
@charleslouis
charleslouis / clean_var_dump.php
Created October 31, 2018 05:53
Une var_export() + colors instead of var_dum() for pretty dump
// src: https://stackoverflow.com/questions/19816438/make-var-dump-look-pretty
<?php
highlight_string("<?php\n\$item =\n" . var_export($item, true) . ";\n?>");
@charleslouis
charleslouis / clear.txt
Created September 22, 2018 17:22 — forked from EQuimper/clear.txt
React-Native clear Watchman + Cache
watchman watch-del-all && rm -rf node_modules/ && npm install --cache /tmp/empty-cache && npm start --reset-cache
export function addClassToBodyOnscroll(elementReference) {
let timer;
const mainNav = $(elementReference);
const mainNavH = mainNav.outerHeight();
console.group('scrollTop');
console.log('mainNavH', mainNavH);
console.groupEnd();
$(window).scroll(function() {
$banner-play-button-background: $primary-color;
$banner-play-button-background-hover: $secondary-color;
$banner-play-button-box-shadow: 0 0 1px 0 rgba(80, 85, 103, 0.39),0 7px 9px 0 rgba(94, 94, 94, 0.18);
$banner-play-button-size: 5rem;
$banner-play-button-background-size: 40%;
$banner-play-button-background-position: 55% center;
$banner-play-button-color: $white;
$banner-play-button-image: url('assets/images/graphics/icone-play.svg');
$hero-bg-color: $light-gray;
export function detectTouch() {
// source https://codeburst.io/the-only-way-to-detect-touch-with-javascript-7791a3346685
window.addEventListener('touchstart', function onFirstTouch() {
// we could use a class
document.body.classList.add('user-is-touching');
// or set some global variable
// window.USER_IS_TOUCHING = true;
// or set your app's state however you normally would
// frameworkOfChoice.dispatchEvent('USER_IS_TOUCHING', true);
// we only need to know once that a human touched the screen, so we can stop listening now
@charleslouis
charleslouis / composer-private-package-github-token.md
Created July 24, 2018 06:55 — forked from jeffersonmartin/composer-private-package-github-token.md
Generate a GitHub Personal Access Token for Private Composer Packages

Generate a GitHub Personal Access Token for Private Composer Packages

If you're trying to load a private repository with Composer/Laravel, we'll need to generate a GitHub Personal Access Token (similar to OAuth token) to access the repository during a composer install without entering credentials.

If you have used other Github packages from {my-org} before, you may be able to skip this step.

  1. Visit https://github.com/settings/tokens.

  2. Click Generate new token.

"********************************************************************************
"define mapleader now before it is used by anything else
"********************************************************************************
let mapleader = ","
"********************************************************************************
"autoload plug vim
"********************************************************************************
if empty(glob('~/.vim/autoload/plug.vim'))
"********************************************************************************
"define mapleader now before it is used by anything else
"********************************************************************************
let mapleader = ","
"********************************************************************************
"autoload plug vim
"********************************************************************************
if empty(glob('~/.vim/autoload/plug.vim'))
@charleslouis
charleslouis / cheatsheet.md
Last active October 12, 2019 06:37
Cheat sheet CLI Zsh bash

Vim

-ci' - change inside the single quotes -ciw - change inside a word -ci( - change inside parentheses -dit - delete inside an HTML tag, etc -80i * ^[ make a line of 80* -fn12 = nohls -:FZF to bring FuzzyFile -^N to open NerdTree

@charleslouis
charleslouis / Zencash-command.md
Created April 30, 2018 04:01
Commands Zencash node

pm2 logs to see if Zend is authenticated

In case the previous pm2 process has some residual configuration in memory, the --update-env made the pm2 process reload fresh pm2 stop 0 &amp;&amp; pm2 start 0 --update-env &amp;&amp; pm2 logs