Skip to content

Instantly share code, notes, and snippets.

hey 2

How are you

  • one
  • two
  • tree

$ sqrt sqrt root3x $

@franleplant
franleplant / main.sh
Created July 28, 2014 15:47
Install Git Latest of Ubuntu 12.04
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
@franleplant
franleplant / i.md
Last active August 29, 2015 14:05
ideal optimization with Gulp!

The key gulp plugins used are

gulp-inject //: injects automatically the js files (vendors are added manually)

gulp-useref //: otpimizes and copies

gulpfile

{ echo line 1: PASS; echo line 2: FAIL; } |
awk -v "red=$(tput setaf 1)" -v "green=$(tput setaf 2)" \
-v "reset=$(tput sgr0)" '
{ for (i = 1; i <= NF; i++) {
if ($i == "FAIL") printf "%s", red "FAIL" reset;
else if ($i == "PASS") printf "%s", green "PASS" reset;
else printf "%s", $i
if (i == NF) printf "%s", ORS
else printf "%s", OFS
@franleplant
franleplant / .gitconfig
Created November 27, 2014 17:15
Global Git Configs
[user]
name = franleplant
email = franleplant@gmail.com
[core]
editor = vim
excludesfile = ~/.gitignore
@franleplant
franleplant / index.md
Created December 29, 2014 14:19
Colors I like

Shouting pink

rgba(18,18,18,0);

@franleplant
franleplant / index.md
Last active August 29, 2015 14:12
Interesting Cli commands
  • ctrl z and fg suspend the current process (for example vim) and un suspend it. Useful to move back and forth from Vim and the command line, and possible from other programas and the comand line.

  • lsof -n | grep TCP list all processes that are using TCP

  • dirs, popd, pushd for using a stack of directories to easily switch between them

  • grep and return surrounding lines with flags -A number (after), -B number (before) and -C number (before and after)

  • pstree to check process hierachie

  • killall notify-osd kill GTK notifications in KDE

@franleplant
franleplant / index.js
Created January 14, 2015 13:36
Composability vs "inheritance" in Flux's Stores
/*
The intention behind this example is to demonstrate how to **compose**
instead of **inherit**, this simplifies the code by using EventEmmitter
as a service instead of using the pattern know as Prototypal inheritance
which is know to have several draw backs, since it **does not work
like clasical inheritance**
Example Extracted from https://scotch.io/tutorials/getting-to-know-flux-the-react-js-architecture
*/
@franleplant
franleplant / a.md
Created February 9, 2015 14:17
Blog ideas!

Unique Javascript Code Style!

Why?

  • It will enable automatic formatting tools (like go's fmt)
  • It will take away trivial questions to be answered by developers (should i put a space before () in a function declaration?)
  • It will boost productivity
  • It will make js development easier by not buthering devs about it
  • It will make js code homogeneous (in this matter)
@franleplant
franleplant / 0_reuse_code.js
Last active August 29, 2015 14:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console