# Creating a lambda
l = lambda { |name| "Hi #{name}!" }
# Executing the lambda
l.call("foo") # => Hi foo!
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
# Remove old docker containers | |
docker rm $(docker ps --no-trunc -aq) | |
# Remove unreferenced images | |
docker images | grep "<none>" | awk '{print $3}' | xargs docker rmi | |
#OR | |
#alias dockercleancontainers="docker ps -a -notrunc| grep 'Exit' | awk '{print \$1}' | xargs -L 1 -r docker rm" |
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
// In v2/3 you did this: | |
import ReactDOM from 'react-dom' | |
import { Router, browserHistory, Route } from 'react-router' | |
ReactDOM.render( | |
<Router> | |
<Route path="/about" component={About}/> | |
<Route path="/:username" component={User}/> | |
</Router> | |
) |
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
/** | |
* @providesModule PatientList | |
*/ | |
import NavigationBar from 'react-native-navbar'; | |
import NavigationButtons from 'NavigationButtons'; | |
import React, { ListView, Navigator, StyleSheet, Text, TextInput, TouchableHighlight, View } from 'react-native'; | |
import { connect } from 'react-redux/native' | |
@connect(state => ({ | |
patients: state.patients |
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
#!/bin/sh | |
# iPhone 3.5" @2x $* | |
sips -Z 960 -c 960 640 Default-Input.png --out Images.xcassets/LaunchImage.launchimage/Default640x960.png $* | |
# iPhone 3.5" @1x $* | |
sips -Z 480 Images.xcassets/LaunchImage.launchimage/Default640x960.png --out Images.xcassets/LaunchImage.launchimage/Default320x480.png $* | |
# iPhone 4.0" @2x $* | |
sips -Z 1136 -c 1136 640 Default-Input.png --out Images.xcassets/LaunchImage.launchimage/Default640x1136.png $* | |
# iPhone 5.5" @3x - landscape | |
sips -Z 2208 -c 1242 2208 Default-Input.png --out Images.xcassets/LaunchImage.launchimage/Default2208x1242.png $* |
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
100 - Thin | |
200 - Extra Light, Ultra Light | |
300 - Light | |
400 - Normal, Book, Regular | |
500 - Medium | |
600 - Semi Bold, Demi Bold | |
700 - Bold | |
800 - Extra Bold, Ultra Bold | |
900 - Black, Heavy |
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
import React, { Component } from 'react' | |
import PropTypes from 'react-proptypes' | |
import styles from './App.css' | |
class Wizard extends Component { | |
static childContextTypes = { | |
activeIndex: PropTypes.number.isRequired, | |
totalSteps: PropTypes.number.isRequired, | |
goToNextStep: PropTypes.func.isRequired, | |
goToPrevStep: PropTypes.func.isRequired |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
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
PASSWORD_VALIDATOR = /( # Start of group | |
(?: # Start of nonmatching group, 4 possible solutions | |
(?=.*[a-z]) # Must contain one lowercase character | |
(?=.*[A-Z]) # Must contain one uppercase character | |
(?=.*\W) # Must contain one non-word character or symbol | |
| # or... | |
(?=.*\d) # Must contain one digit from 0-9 | |
(?=.*[A-Z]) # Must contain one uppercase character | |
(?=.*\W) # Must contain one non-word character or symbol | |
| # or... |