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
# Comprehensive sample .gitignore file for reference | |
############################################# | |
# compiled from github.com/github/gitignore # | |
############################################# | |
### Custom ### | |
*.db | |
*.sqlite |
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
/** | |
* ------------------ The Life-Cycle of a Composite Component ------------------ | |
* | |
* - constructor: Initialization of state. The instance is now retained. | |
* - componentWillMount() | |
* - render() | |
* - [children's constructors] | |
* - [children's componentWillMount and render] | |
* - [children's componentDidMount] | |
* - componentDidMount() |
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
import { Conversation } from 'chat-template'; | |
import ReactDOM from 'react-dom'; | |
import React from 'react'; | |
const showChatTemplate = (messages, element, delay = 1, height = 300) => { | |
ReactDOM.render(<Conversation delay={delay} height={height} messages={messages} />, | |
element); | |
}; | |
module.exports = showChatTemplate; |
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
// Conversion to Two's Complement | |
//Note that this works both ways. If you have -30, and want to represent it in 2's complement, | |
// take the binary representation of 30: | |
0000 0000 0000 0000 0000 0000 0001 1110 | |
// Invert the digits. |
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
import * as DomEvent from './DomEvent'; | |
import * as Util from '../core/Util'; | |
import * as Browser from '../core/Browser'; | |
/* | |
* Extends L.DomEvent to provide touch support for Internet Explorer and Windows-based devices. | |
*/ | |
var POINTER_DOWN = Browser.msPointer ? 'MSPointerDown' : 'pointerdown'; |
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
git fetch upstream | |
git reset --hard upstream/master |
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
git fetch upstream | |
git reset --hard upstream/master |
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
$ ls -lah | |
$ sudo chown -R <username> <directory_name> |
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
refile problem - need to use downgraded bundler version to install gems | |
```Bash | |
$ gem install bundler -v 2.0.1 | |
$ bundle _2.0.1_ install | |
``` |
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
## Rendering with status and location headers: | |
All renders take the :status and :location options and turn them into headers. They can even be used together: | |
```Ruby | |
render :xml => post.to_xml, :status => :created, :location => post_url(post) | |
``` | |
Note that the :status option accepts not only an HTTP status code (such as 500), | |
but also a symbol representing that code (such as :created), if that makes more sense to you. |
OlderNewer