The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the
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
/** | |
* Save Reminder | |
* Date: February 1, 2018 | |
* Author: Shawn Hymel (SparkFun Electronics) | |
* | |
* Connect to an open USB port on your computer. Every 5 minutes, | |
* the LED will begin flashing. Press the button to send a ctl+s | |
* or cmd+s key press to your computer to save your work. | |
* | |
* Pick your operating system by updating the OS variable. |
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
/*! | |
file to place in the JEST setupFiles options | |
https://github.com/tmpvar/jsdom/issues/639#issuecomment-259296780 | |
*/ | |
class Util { | |
constructor() { | |
this.counter = 1; | |
this.expando = 'mo_id'; | |
} |
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
const fs = require('fs'); | |
// Monkey-patch react-dev-utils to get the error overlay with SSR | |
const pathToDevClient = 'node_modules/react-dev-utils/webpackHotDevClient.js'; | |
// The react-scripts default | |
const reactScriptsPort = 3000; | |
// Read the dev client out of node_modules | |
const HotDevClient = fs.readFileSync(pathToDevClient, 'utf8'); |
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
// connect() is a function that injects Redux-related props into your component. | |
// You can inject data and callbacks that change that data by dispatching actions. | |
function connect(mapStateToProps, mapDispatchToProps) { | |
// It lets us inject component as the last step so people can use it as a decorator. | |
// Generally you don't need to worry about it. | |
return function (WrappedComponent) { | |
// It returns a component | |
return class extends React.Component { | |
render() { | |
return ( |
This post is also on my blog, since Gist doesn't support @ notifications.
Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:
- Use Ember CLI
- In general, replace views + controllers with components
- Only use controllers at the top-level for receiving data from the route, and use
Ember.Controller
instead ofEmber.ArrayController
orEmber.ObjectController
- Fetch data in your route, and set it as normal properties on your top-level controller. Export an
Ember.Controller
, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.
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
var EmberApp = require('ember-cli/lib/broccoli/ember-app'); | |
var pickFiles = require('broccoli-static-compiler'); | |
var mergeTrees = require('broccoli-merge-trees'); | |
var vulcanize = require('broccoli-vulcanize'); | |
var app = new EmberApp(); | |
var polymerVulcanize = vulcanize('app', { | |
input: 'elements.html', | |
output: 'assets/vulcanized.html', |
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
[ | |
{ | |
"timestamp": 0, | |
"input": "W", | |
"type": "search_local", | |
"latency": 0 | |
}, | |
{ | |
"local_results": [ | |
"ddg_search", |
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
var randomNumbers = [42, 12, 88, 62, 63, 56, 1, 77, 88, 97, 97, 20, 45, 91, 62, 2, 15, 31, 59, 5] | |
func partition(v: Int[], left: Int, right: Int) -> Int { | |
var i = left | |
for j in (left + 1)..(right + 1) { | |
if v[j] < v[left] { | |
i += 1 | |
(v[i], v[j]) = (v[j], v[i]) | |
} | |
} |
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
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all. | |
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one. | |
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format | |
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files. | |
$ cd /tmp/ | |
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist . | |
$ plutil -convert xml1 com.googlecode.iterm2.plist | |
$ vi com.googlecode.iterm2.plist |
NewerOlder