-
Go to https://developer.apple.com/downloads/index.action and search for "Command line tools" and choose the one for your Mac OSX
-
Go to http://brew.sh/ and enter the one-liner into the Terminal, you now have
brewinstalled (a better Mac ports) -
Install transmission-daemon with
brew install transmission -
Copy the startup config for launchctl with
ln -sfv /usr/local/opt/transmission/*.plist ~/Library/LaunchAgents
| var spawn = require('child_process').spawn, | |
| createSpawn = function(command) { | |
| var cmd = spawn(command, []); | |
| try { | |
| console.log('running command: ' + command); | |
| cmd.stdout.on('data', function(data){ | |
| process.stdout.write(data); | |
| }); | |
| cmd.stderr.on('data', function(data) { | |
| // process.stdout.write('ERROR:' + data); |
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
Gist is no longer being updated, view repository at https://github.com/jgornick/mdashboard
Marionette 3 is currently in development, but one of its main thrusts is going to be simplifying the concepts needed for Marionette Developers. This involves deprecating and renaming some features. This gist is meant to provide a mapping of V2 to V3 concepts to help developers plan for and understand v3.
Disclaimers:
- this is not an official document
- I'm not on the Mn core team, this is just the understanding of an observer of the library
- Mn V3 is still in development. I'll try to keep this document up to date, but if something looks wrong please leave a comment and double check.
React now supports the use of ES6 classes as an alternative to React.createClass().
React's concept of Mixins, however, doesn't have a corollary when using ES6 classes. This left the community without an established pattern for code that both handles cross-cutting concerns and requires access to Component Life Cycle Methods.
In this gist, @sebmarkbage proposed an alternative pattern to React mixins: decorate components with a wrapping "higher order" component that handles whatever lifecycle methods it needs to and then invokes the wrapped component in its render() method, passing through props.
While a viable solution, this has a few drawbacks:
- There's no way for the child component to override functionality defined on the higher order component.
PS: If you liked this talk or like this concept, let's chat about iOS development at Stitch Fix! #shamelessplug
Speaker: David Abrahams. (Tech lead for Swift standard library)
-
"Crusty" is an old-school programmer who doesn't trust IDE's, debuggers, programming fads. He's cynical, grumpy.
-
OOP has been around since the 1970's. It's not actually new.
-
Classes are Awesome
- Encapsulation
- Access control
| // Usage: | |
| // Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread | |
| // then use as follows: | |
| // | |
| // query(term | [term, term, ...], term | [term, term, ...], ...) | |
| // | |
| // When arguments are in an array then that means an "or" and when they are seperate that means "and" | |
| // | |
| // Term is of the format: | |
| // ((-)text/RegExp) ( '-' means negation ) |
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
| // KeyboardAvoidable | |
| // Roy McKenzie | |
| protocol KeyboardAvoidable: class { | |
| func addKeyboardObservers(customBlock: ((CGFloat) -> Void)?) | |
| func removeKeyboardObservers() | |
| var layoutConstraintsToAdjust: [NSLayoutConstraint] { get } | |
| } | |
| var KeyboardShowObserverObjectKey: UInt8 = 1 |