This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_support/all' | |
@candidates = [ | |
{ | |
id: 5, | |
years_of_experience: 4, | |
github_points: 293, | |
languages: ['C', 'Ruby', 'Python', 'Clojure'], | |
date_applied: 5.days.ago.to_date, | |
age: 26 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Check for ruby style errors | |
red='\033[0;31m' | |
green='\033[0;32m' | |
yellow='\033[0;33m' | |
NC='\033[0m' | |
if git rev-parse --verify HEAD >/dev/null 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sys = require("sys"); | |
var exec = require('child_process').exec; | |
var five = require('johnny-five'); | |
var board = new five.Board(); | |
function puts(err, stdout, stderr) { sys.puts(stdout) }; | |
board.on('ready', function() { | |
console.log("board ready"); | |
var button = new five.Button(5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sys = require("sys"); | |
var exec = require('child_process').exec; | |
var five = require('johnny-five'); | |
var board = new five.Board(); | |
function puts(err, stdout, stderr) { sys.puts(stdout) }; | |
board.on('ready', function() { | |
console.log("board ready"); | |
var button = new five.Button(5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (file, api) { | |
var j = api.jscodeshift; | |
var root = j(file.source); | |
// Finds the all classes that have properties | |
root | |
.find(j.ClassDeclaration, { | |
body: { | |
type: 'ClassBody', | |
body: [{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" => General | |
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" Enable Pathogen | |
execute pathogen#infect() | |
syntax on | |
" Enable filetype plugins | |
filetype plugin on | |
filetype indent on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Main extends React.Component { | |
// ... | |
render() { | |
// We should NEVER pass anonymous functions as props to React components unless | |
// we absolutely need to. | |
// | |
// Anonymous functions are redefined on every render cycle, which means | |
// the function you pass to your child component is different every time. | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
render() { | |
return ( | |
<div> | |
<Button | |
label='Click me to increment!' | |
onClicked={() => { this.setState({count: this.state.count + 1}) }} | |
/> | |
<Button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
render() { | |
return ( | |
<div> | |
<Button | |
label='Click me to increment!' | |
onClicked={this._handleIncrementView} | |
/> | |
<Button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Main extends React.Component { | |
// ... | |
render() { | |
// Because we've named the prop `this._handleClick`, we're now passing a FUNCTION REFERENCE and | |
// no longer creating a new function on every render cycle. The function reference will not change throughout | |
// the lifecycle of `Main`, therefore it will never cause `Button` to re-render. | |
return ( | |
<div> | |
<p>This button has been clicked {count} times</p> |
OlderNewer