Skip to content

Instantly share code, notes, and snippets.

View YannickLeRoux's full-sized avatar
🏠
Working from home

Yannick YannickLeRoux

🏠
Working from home
View GitHub Profile
@YannickLeRoux
YannickLeRoux / .vimrc
Last active February 4, 2018 04:44
My vimrc config
" ======= @YannickLeRoux : my .vimrc config for Python and Javascript ===========
execute pathogen#infect()
syntax on
filetype plugin indent on
let g:airline#extensions#tabline#enabled = 1
set mouse=a
" syntax check for python 3
@YannickLeRoux
YannickLeRoux / .zshrc
Last active May 13, 2020 16:33
My config file for zsh (old mac book)
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/yannickleroux/.oh-my-zsh
# Setting PATH for Python 3.6
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
export PATH
@YannickLeRoux
YannickLeRoux / eslintrc.js
Last active January 7, 2019 22:10
My Eslint config file to work with React Native
// npm install -g eslint
// eslint --init
module.exports = {
"extends": "airbnb",
"env": {
"browser": true,
"node": true,
"mocha": true
@YannickLeRoux
YannickLeRoux / eloquentjs-chapter4
Created October 16, 2018 05:35
Eloquent JavaScript - chapter 4
function arrayToList(arr) {
let list = { value: arr[arr.length - 1], rest: null };
for ( let i=arr.length - 1; i>=0; i--) {
list = { value: arr[i], rest: list}
}
return list;
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
@YannickLeRoux
YannickLeRoux / javascript.json
Created January 18, 2019 22:05
Javascript VS Code User Snippets
{
// Place your snippets for javascript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": ["console.log('$1',$2);"],
"description": "Log output to console"
def list_squared(m, n):
# your code
sqrtDivisors =[]
for num in range(m, n+1):
divisors = []
for i in range(1, num+1):
if num % i == 0:
divisors.append(i)
@YannickLeRoux
YannickLeRoux / render-props-no-jsx
Created February 27, 2019 03:46
Understand React Render Props
import React from "react";
import ReactDOM from "react-dom";
import "./styles.css";
class Toggle extends React.Component {
state = { on: false };
toggle = () => this.setState({ on: !this.state.on });
render() {
return this.props.children({ on: this.state.on, toggle: this.toggle });
@YannickLeRoux
YannickLeRoux / checkNested.js
Created March 8, 2019 00:07
Chech if nested property exist in object
function checkNested(obj /*, level1, level2, ... levelN*/) {
var args = Array.prototype.slice.call(arguments, 1);
for (var i = 0; i < args.length; i++) {
if (!obj || !obj.hasOwnProperty(args[i])) {
return false;
}
obj = obj[args[i]];
}
return true;
}