Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');| RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache | |
| RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache | |
| RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache | |
| npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache | |
| Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
| /** | |
| * Adds Alt+Shift shortcut for swapping languages in Google Translate. | |
| * Best used with browser JS injectors such as | |
| * https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija | |
| */ | |
| (function () { | |
| var shiftKeyPressed = false, | |
| altKeyPressed = false, | |
| swap = document.querySelector('#gt-swap'); |
| git branch -m master newname | |
| git push origin newname | |
| # Change "Default Branch" in settings/options in GitHub | |
| git push origin :master |
| #!/bin/bash | |
| # A script to convert a CSV (excel export) file into JSON | |
| # Usage ./csv2json input.csv > output.json | |
| # Slightly modified version of SECAGUY's: | |
| # http://blog.secaserver.com/2013/12/convert-csv-json-bash/ | |
| input=$1 | |
| [ -z $1 ] && echo "No CSV input file specified" && exit 1 | |
| [ ! -e $input ] && echo "Unable to locate $1" && exit 1 |
| # Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key | |
| # that enables you to choose a character from a menu of options. If you are on Lion | |
| # try it by pressing and holding down 'e' in any app that uses the default NSTextField | |
| # for input. | |
| # | |
| # It's a nice feature and continues the blending of Mac OS X and iOS features. However, | |
| # it's a nightmare to deal with in Atom if you're running vim mode, | |
| # as it means you cannot press and hold h/j/k/l to move through your file. You have | |
| # to repeatedly press the keys to navigate. |
#Create a redirect server in Node.js
'use strict'
var http = require('http');
var mappings = {
g: 'http://www.google.com'