Skip to content

Instantly share code, notes, and snippets.

Closures in javascript

a normal function

declare the function

var add = function(x, y) {
  return x + y;
};

Influencers

Common sets of principles and skills that help create quick, profound, and lasting change.
What qualifies 'leaders' is their capacity to influence others to change their behaviors in order to achieve important results.
It is not persuasion.

3 keys to influence

  1. focus and measure
  2. find vital behaviors
  3. engage all 6 sources of influence
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"auto_complete_delay": 0,
"auto_complete_selector": "source - comment",
"auto_complete_size_limit": 4194304,
"auto_complete_triggers":
[
{
"characters": "<",
@Jauny
Jauny / app.js
Last active January 3, 2016 22:09
//= require_tree ./models
//= require_tree ./collections
//= require_tree ./views
$(function () {
var App = {
Models: {},
Views: {},
Collections: {}
@Jauny
Jauny / gist:3992131
Created November 1, 2012 06:10
coffe vs script
mood = greatlyImproved if singing
if happy and knowsIt
clapsHands()
chaChaCha()
else
showIt()
date = if friday then sue else jill
SELECT alls.the_thing, others.thing FROM alls
INNER JOIN others ON alls.id = others.all_id
WHERE alls.the_thing = 'ROCKS'
ORDER BY alls.the_thing DESC
LIMIT 9000
OrangeTree.new(12, 24)
@Jauny
Jauny / gist:3876531
Created October 12, 2012 00:08
Understanding blocks, Procs and lambda!

#Understanding blocks, Procs and lambdas. I think blocks, Procs and lambdas are working in a really counter-intuitive way when you
first try to understand how they work, and most of the (amazing) resources one can find online
are too complicated to allow to understand how they work without frustration...

So here is my take on it; I'll try to make it as simple and concise as possible,
and will focus on how it is used, instead of how it works under the hood.

##Blocks A block is simply a piece of code that will (usually) execute something;

@Jauny
Jauny / gist:3869758
Created October 11, 2012 02:13
Hash#sort

#Sorting a Hash I wanted to understand what happened under the hood when something like

hash.sort { |a, b| b[1] <=> a[1] }

is called. If you can't answer, you might want to read.
I'll be as basic as possible (I don't know much anyway...) so it should be understandable.


First let's begin by saying that we will be working on this hash

# Put your answers here!