You probably came here because your code is calling your component as a plain function call. This is now deprecated:
var MyComponent = require('MyComponent');
function render() {
return MyComponent({ foo: 'bar' }); // WARNING
Rails Singleton Model | |
Taken from: | |
http://stackoverflow.com/questions/399447/how-to-implement-a-singleton-model/12463209#12463209 |
var DEBUG = true; | |
//var name = "name", type = "type", stage = "stage", caught = "caught"; | |
var grass = "grass", water = "water", fire = "fire", bug = "bug", | |
psychic = "psychic", flying = "flying", ghost = "ghost", fighting = "fighting", | |
normal = "normal", poison = "poison", electric = "electric", ground = "ground", | |
fairy = "fairy", rock = "rock", ice = "ice", dragon = "dragon"; | |
var Pokemon = [ | |
{ name : "MissingNo", type : "blank", stage : 100, caught : 0, species : "Glitch Pokemon"}, |
// Computes the SHA-256 digest of a string with Web Crypto | |
// Source: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest | |
function sha256(str) { | |
// Get the string as arraybuffer. | |
var buffer = new TextEncoder("utf-8").encode(str) | |
return crypto.subtle.digest("SHA-256", buffer).then(function(hash) { | |
return hex(hash) | |
}) | |
} |
# | |
# Ref: | |
# * https://gist.github.com/vojd/a2d277bc161a2674aeaa | |
# * https://gist.github.com/Sigmus/9253068 | |
# | |
source = require 'vinyl-source-stream' | |
gulp = require 'gulp' | |
gutil = require 'gulp-util' | |
browserify = require 'browserify' |
// | |
// Ok look, I know this is a bad idea but I'm doing this as an experiment. I'm going to get really granular with these, | |
// which makes them basically unsuable. But it gives a decent overview of the diversity of iThangs. | |
// So chill. | |
// | |
// References: | |
// http://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions | |
// https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries#-moz-device-pixel-ratio | |
// http://stephen.io/mediaqueries/ | |
// |
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
require 'oauth' | |
consumer = OAuth::Consumer.new( | |
"CONSUMER_KEY", | |
"CONSUMER_SECRET", | |
{ | |
site: "https://trello.com", | |
request_token_url: "https://trello.com/1/OAuthGetRequestToken", | |
authorize_url: "https://trello.com/1/OAuthAuthorizeToken", | |
access_token_url: "https://trello.com/1/OAuthGetAccessToken" |
In React 0.12, we're making a core change to how React.createClass(...)
and JSX works.
If you're using JSX in the typical way for all (and only) React components, then this transition will be seamless. Otherwise there are some minor breaking changes described below.
The Problem
# lib/tasks/db.rake | |
namespace :db do | |
desc "Dumps the database to db/APP_NAME.dump" | |
task :dump => :environment do | |
cmd = nil | |
with_config do |app, host, db, user| | |
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
end | |
puts cmd |