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 TweetBox = React.createClass({ | |
getInitialState(){ | |
return {remaining: 140} | |
}, | |
handleKeyUp() { | |
var text = this.refs.tweettweet.getDOMNode().value; | |
this.setState({remaining: (140 - text.length)}); | |
}, | |
render() { | |
return <div className="tweetbox"> |
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
{ | |
"pizza": [ | |
"https://upload.wikimedia.org/wikipedia/commons/1/1a/KS_pepperoni_pizza.JPG", | |
"https://upload.wikimedia.org/wikipedia/commons/d/d1/Pepperoni_pizza.jpg", | |
"http://www.daroberto.nl/wp-content/uploads/2013/03/pizza.jpg" | |
] | |
} |
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
{ | |
"pancakes": [ | |
"http://media.gizmodo.co.uk/wp-content/uploads/2013/02/pancakes.jpg", | |
"http://i.huffpost.com/gen/1650799/images/o-PANCAKE-facebook.jpg", | |
"http://imparteretete.reginele.ro/wp-content/uploads/2013/06/clatite-americane.jpg", | |
"http://cdn.images.express.co.uk/img/dynamic/1/590x/pancakes-yum-376875.jpg", | |
"http://cooking-bg.com/wp-content/uploads/2013/12/pancakes.jpg", | |
"http://www.taste.com.au/images/recipes/agt/2003/02/12897_l.jpg" | |
] | |
} |
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
// Allows json to not have a root element | |
// Allows embedded records for "images" instead of "image_ids" or "images" being the ids | |
import DS from 'ember-data'; | |
export default DS.RESTSerializer.extend(DS.EmbeddedRecordsMixin, { | |
isNewSerializerAPI: true, | |
attrs: { | |
images: {embedded: 'always'}, | |
}, |
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' | |
### We can send in a proc (or a lambda) for the method to call when we want it | |
### to run. the proc behaves like a normal argument | |
$array = %w(apple banana kumquat) | |
def titlize_fruits(proc) | |
proc.call $array.pop | |
proc.call $array.pop |
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
package main | |
import ( | |
"database/sql" | |
"github.com/ant0ine/go-json-rest/rest" | |
_ "github.com/lib/pq" | |
"log" | |
"net/http" | |
) |
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 timer = setTimeout("contentRefresh()", 1000 * 60 * 5);function contentRefresh(){self.location.reload(true)} |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
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
# Assign "Hello World" to a variable message | |
# Assign a different string to a different variable | |
# Assign a number to a variable | |
# Use string interpolation to display the number in a string | |
# string interpolation = "#{}" | |
# Make an array of your favorite movies or books or bands. Have at least 4 values. |
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
# Assign "Hello World" to a variable message | |
yolo = "Hello World" | |
# Assign a different string to a different variable | |
# Assign a number to a variable | |
# Use string interpolation to display the number in a string | |
# string interpolation = "#{}" |