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
import React from "react"; | |
const Box = ({ num }) => { | |
const [state, setState] = React.useState(num); | |
React.useEffect(() => { | |
setState(num); | |
}, [num]); | |
return <div>child state ${state}</div>; |
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
import React from "react"; | |
const Box = ({ num }) => { | |
const [state, setState] = React.useState(num); | |
return <div>child state ${state}</div>; | |
}; | |
const App = () => { | |
const [state, setState] = React.useState(); |
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 'formula' | |
class Libstemmer < Formula | |
# upstream is constantly changing the tarball, | |
# so doing checksum verification here would require | |
# constant, rapid updates to this formula. | |
head 'http://snowball.tartarus.org/dist/libstemmer_c.tgz' | |
homepage 'http://snowball.tartarus.org/' | |
end |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
Pod::Spec.new do |s| | |
s.name = 'CocoaHTTPServer' | |
s.version = '2.2.1' | |
s.license = 'BSD' | |
s.summary = 'A small, lightweight, embeddable HTTP server for Mac OS X or iOS applications' | |
s.homepage = 'https://github.com/robbiehanson/CocoaHTTPServer' | |
s.authors = { 'Robbie Hanson' => 'cocoahttpserver@googlegroups.com' } | |
s.source = { :git => 'https://github.com/robbiehanson/CocoaHTTPServer.git', :tag => '2.2.1' } | |
s.source_files = '{Core,Extensions}/**/*.{h,m}' | |
s.clean_paths = %w{Samples Vendor} |
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
Pod::Spec.new do |s| | |
s.name = 'RestKit' | |
s.version = '0.9.3' | |
s.summary = 'RestKit is a framework for consuming and modeling RESTful web resources on iOS and OS X.' | |
s.homepage = 'http://www.restkit.org' | |
s.author = { 'Blake Watters' => 'blakewatters@gmail.com' } | |
s.source = { :git => 'https://github.com/RestKit/RestKit.git' } | |
# It has no source_files itself, so the resolver should not allow dependencies on this spec unless it’s a `part_of' type dependency |
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 User | |
include UserModules::Invitation | |
end | |
module UserModules::Invitation | |
extend ActiveSupport::Concern | |
included do | |
validate :validate_invitation_code | |
after_create :apply_invitation_code | |
has_one :invitation, :class_name => "InvitationCode" |
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 User | |
include UserModules::Invitation | |
end | |
module UserModules::Invitation | |
extend ActiveSupport::Concern | |
included do | |
validate :validate_invitation_code | |
after_create :apply_invitation_code | |
has_one :invitation, :class_name => "InvitationCode" |