Skip to content

Instantly share code, notes, and snippets.

CharlesLouis charleslouis

Block or report user

Report or block charleslouis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@charleslouis
charleslouis / clean_var_dump.php
Created Oct 31, 2018
Une var_export() + colors instead of var_dum() for pretty dump
View clean_var_dump.php
// 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 Sep 22, 2018 — forked from EQuimper/clear.txt
React-Native clear Watchman + Cache
View clear.txt
watchman watch-del-all && rm -rf node_modules/ && npm install --cache /tmp/empty-cache && npm start --reset-cache
View addClassToBodyOnscroll.js
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() {
View hero-youtube-full-bg-video.scss
$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;
View detectTouch.js
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 Jul 24, 2018 — forked from jeffersonmartin/composer-private-package-github-token.md
Generate a GitHub Personal Access Token for Private Composer Packages
View composer-private-package-github-token.md

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.

View .vimrc
"********************************************************************************
"define mapleader now before it is used by anything else
"********************************************************************************
let mapleader = ","
"********************************************************************************
"autoload plug vim
"********************************************************************************
if empty(glob('~/.vim/autoload/plug.vim'))
View .vimrc
"********************************************************************************
"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 Oct 12, 2019
Cheat sheet CLI Zsh bash
View cheatsheet.md

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

View Zencash-command.md

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 && pm2 start 0 --update-env && pm2 logs

You can’t perform that action at this time.