Skip to content

Instantly share code, notes, and snippets.

View charleslouis's full-sized avatar

okcharlo charleslouis

View GitHub Profile
@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() {
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
"********************************************************************************
"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 / 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 && pm2 start 0 --update-env && pm2 logs

@charleslouis
charleslouis / nvidia-driver-install-guide ubuntu.md
Last active April 28, 2018 12:07
nvidia-driver-install-guide ubuntu

Ubuntu/Mint Install Nvidia Drivers GTX950-GTX TITAN X 2016

See https://www.youtube.com/watch?v=cVTsemATIyI

Ajoutée le 28 août 2015

This tutorial was made for the GTX 950, GTX 960, GTX 970, GTX 980, GTX 980 Ti, and GTX TITAN X.

UPDATE: I have updated the commands in here with the most recent driver Nvidia recommends for the GTX950-GTX TITAN X This guide will help you set up your Nvidia graphics card even if you boot to a blank sceen or are completely locked out of your GUI.

@charleslouis
charleslouis / youtube-play-video.js
Last active February 9, 2018 15:37
Youtube iframe ajax auto player with poster
'use strict';
// je déclare mes fonctions
function playTheVideoOnClick(idWrapper, posterClass, idVideoAttr){
// lancement de la video si clic sur button play sur cover image
$(idWrapper).click(function(){
var idVideo = $(this).attr(idVideoAttr);
var videoIframe = '<iframe width="560" height="315" src="https://www.youtube.com/embed/' + idVideo + '?rel=0&amp;showinfo=0&autoplay=1" frameborder="0" allowfullscreen></iframe>';
$(this).append(videoIframe);
$(this).find(posterClass).fadeOut();
@charleslouis
charleslouis / Docker-helpers.md
Last active October 23, 2017 03:56
Docker, postgres, sails.js

list containers

docker ps -a

Postgres

  • docker pull postgres
  • docker build -t postgres .

Connect to Postgres

docker exec -it postgres psql -U postgres

@charleslouis
charleslouis / wp-cli_tools
Last active July 8, 2017 03:12
#WP-CLI, #Wordpress, #shell, #Alias, #batch, aliases, helpers and shortcuts for wp-cli,
##########################################
# WP-cli
##########################################
ALIASES
##########################################
alias wpcdl=wp_core_download