npm list -g --depth=0
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
| (() => { | |
| const up$ = new MouseEvent("mouseup", { bubbles: true }); | |
| const down$ = new MouseEvent("mousedown", { bubbles: true }); | |
| const node = document.querySelector( | |
| `.js-postActionsFooter button[data-action="multivote"]` | |
| ); | |
| let attempts = 0; |
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
| // in /src directory | |
| import {kphToMph} from './convert'; | |
| class Car { | |
| constructor(speed) { | |
| this.speed = speed; | |
| } | |
| getSpeedInMph() { |
Why this transform is necessary?
Until React Native 24, you import React from 'react-native' package, but this will change on RN 25, you will need to import React from 'react'. You probably have many files that does this, so I've created a codemod to save you a bunch of time
- Install jscodeshif
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
| # Close all notifications | |
| my closeNotifications() | |
| on closeNotifications() | |
| tell application "System Events" to tell process "Notification Center" | |
| set theWindows to every window | |
| repeat with i from 1 to number of items in theWindows | |
| set this_item to item i of theWindows | |
| try | |
| click button 1 of this_item |
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 bash | |
| # fresh-chrome | |
| # | |
| # Use this script on OS X to launch a new instance of Google Chrome | |
| # with its own empty cache, cookies, and user configuration. | |
| # | |
| # The first time you run this script, it will launch a new Google | |
| # Chrome instance with a permanent user-data directory, which you can | |
| # customize below. Perform any initial setup you want to keep on every |
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
| // I'll have a entry point for the server app, like server.js, | |
| // and and entry for the client app, like client.js | |
| // in server.js I do this: | |
| IS_CLIENT = false; | |
| // in client.js I do this: | |
| IS_CLIENT = true; | |
| // Then anywhere in your code you can do this: |
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 React = require('react'); | |
| var $ = require('jquery'); | |
| require('jquery-ui'); | |
| var Dialog = React.createClass({ | |
| componentDidMount: function() { | |
| this.portalNode = this.getDOMNode(); | |
| this.$portal = $(this.portalNode); | |
| this.$portal.dialog({ | |
| autoOpen: false, |
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 Thing = React.createClass({ | |
| render () { | |
| return ( | |
| <div> | |
| {stuff.map(thing => ( // <-- use ( not { | |
| <OtherThing thing={thing}/> | |
| ))} | |
| </div> | |
| ); | |
| } |
PLEASE DO NOT USE THIS. See http://userium.com/ instead.
- Personalized features. Currency, language, country specific deals, taxes, or delivery options are changed based on user's location.
- Registering provides value to users. For example a "Free Trial" button communicates a clear benefit, but a "Register" button doesn't. Unnecessary registration is avoided.