This file contains hidden or 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 Nav, Child; | |
var app = <Nav name="testNav" />; // XML elements, attributes and children are transformed into arguments that are passed to React.createElement | |
// JSX also allows specifying children using XML syntax | |
var nestedApp = <Nav name="testNavNested"><Child name="child-in-Nav"><Nav name="nested-nav" /> </Child></Nav>; | |
// Namespaced Components | |
// namespaced components let you use one component that has other components as attributes | |
var MyFormComponent = React.createClass({ }); | |
// you just need to create your "sub-components" as attributes of the main component: |
This file contains hidden or 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
networksetup -listallnetworkservices | grep "云梯" | parallel networksetup -removenetworkservice |
This file contains hidden or 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 Preferencable | |
module ClassMethods | |
# declare preference names for current class | |
# | |
# @note this method will define a pair of read/write class methods for each field to maintain preferences, | |
# they all conform to the below pattern: | |
# | |
# .preferenced_{field} | |
# .preferenced_{field}(value) | |
# |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# Author: Martin Hong | |
# Date: 2016/04/24 | |
# | |
# Monitor Solr health including replication status | |
# inspired in the script on https://issues.apache.org/jira/browse/SOLR-1855 | |
require 'net/http' | |
require 'optparse' |
This file contains hidden or 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 XXXProjectName | |
class Application < Rails::Application | |
# Settings in config/environments/* take precedence over those specified here. | |
# Application configuration should go into files in config/initializers | |
# -- all .rb files in that directory are automatically loaded. | |
config.to_prepare do | |
# Load application's model / class decorators | |
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c| | |
Rails.configuration.cache_classes ? require(c) : load(c) | |
end |
This file contains hidden or 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
/* For Schemas: */ | |
SELECT default_character_set_name FROM information_schema.SCHEMATA | |
WHERE schema_name = "schemaname"; | |
/* For Tables: */ | |
SELECT CCSA.character_set_name FROM information_schema.`TABLES` T, | |
information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` CCSA | |
WHERE CCSA.collation_name = T.table_collation | |
AND T.table_schema = "schemaname" | |
AND T.table_name = "tablename"; |
This file contains hidden or 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
{ | |
"folders": | |
[ | |
{ | |
"path": "project-source", | |
"folder_exclude_patterns": ["*-source/doc", "*-source/tmp", "*-source/log", "*-source/.yardoc"] | |
}, | |
{ | |
"path": "project-notes" | |
} |
Example: You have a branch refactor
that is quite different from master
. You can't merge all of the
commits, or even every hunk in any single commit or master will break, but you have made a lot of
improvements there that you would like to bring over to master.
Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.
On master:
> git co -b temp
This file contains hidden or 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
# http://theadmin.org/articles/capistrano-variables/ | |
application – required | |
repository – required | |
scm – defaults to :subversion | |
deploy_via – defaults to :checkout | |
revision – defaults to the latest head version | |
rails_env – defaults to ‘production’ | |
rake – defaults to ‘rake’ | |
source – Capistrano::Deploy::SCM object |