- Homebrew should be installed (Command line tools for Xcode are included).
- Install
nvmvia Homebrew
| #install FlameGraph library | |
| cd /opt/ | |
| sudo git clone https://github.com/brendangregg/FlameGraph.git | |
| #make it accesible from any folder | |
| vim ~/.bashrc | |
| ##add these lines anywhere and exit vim (if you can) | |
| export FLAMEPATH=/opt/FlameGraph | |
| PATH=$PATH:$FLAMEPATH | |
| package main | |
| import ( | |
| "bytes" | |
| "compress/gzip" | |
| "database/sql/driver" | |
| "errors" | |
| "fmt" | |
| "github.com/jmoiron/sqlx" | |
| _ "github.com/mattn/go-sqlite3" |
| # 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 Sublime Text if you're running Vintage (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. |
nvm via Homebrew| const createMySocketMiddleware = (url) => { | |
| return storeAPI => { | |
| let socket = createMyWebsocket(url); | |
| socket.on("message", (message) => { | |
| storeAPI.dispatch({ | |
| type : "SOCKET_MESSAGE_RECEIVED", | |
| payload : message | |
| }); | |
| }); |
| <?xml version="1.0" encoding="utf-8"?> | |
| <resources> | |
| <!-- | |
| # Material Design Dimensions | |
| These dimensions are provided as per Material Design Guidelines | |
| to adhere to a 8 dp baseline grid. (With the exception of the | |
| toolbar and notification bar.). | |
| ## References |
| // @flow | |
| import type { | |
| StyleObj, | |
| } from 'react-native/Libraries/StyleSheet/StyleSheetTypes'; | |
| import React from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import { Text, View, StyleSheet } from 'react-native'; | |
| import invariant from 'invariant'; |
| import React from "react"; | |
| class App extends React.Component { | |
| render() { | |
| const { redIntensity, greenIntensity, blueIntensity } = this.state; | |
| const { _setRedIntensity, _setGreenIntensity, _setBlueIntensity } = this; | |
| return ( | |
| <div style={{ display: "flex", flexDirection: "row" }}> | |
| <div | |
| style={{ |
| import React from "react"; | |
| class App extends React.Component { | |
| render() { | |
| return ( | |
| <div style={{ display: "flex", flexDirection: "row" }}> | |
| <Status /> | |
| <Conversation /> | |
| </div> | |
| ); |
| import React from "react"; | |
| import { Button, Text, View } from "react-native"; | |
| class App extends React.Component { | |
| render() { | |
| const remaining = this.state.deadline - this.state.now; | |
| const minutes = Math.floor(remaining / 60000); | |
| const seconds = Math.round((remaining - minutes * 60000) / 1000); | |
| return ( | |
| <View style={{ padding: 10 }}> |