- http://stackoverflow.com/questions/804115 (
rebasevsmerge). - https://www.atlassian.com/git/tutorials/merging-vs-rebasing (
rebasevsmerge) - https://www.atlassian.com/git/tutorials/undoing-changes/ (
resetvscheckoutvsrevert) - http://stackoverflow.com/questions/2221658 (HEAD^ vs HEAD~) (See
git rev-parse) - http://stackoverflow.com/questions/292357 (
pullvsfetch) - http://stackoverflow.com/questions/39651 (
stashvsbranch) - http://stackoverflow.com/questions/8358035 (
resetvscheckoutvsrevert) - http://stackoverflow.com/questions/5798930 (
git resetvsgit rm --cached)
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
| #!/bin/bash | |
| ##################################################### | |
| # Name: Bash CheatSheet for Mac OSX | |
| # | |
| # A little overlook of the Bash basics | |
| # | |
| # Usage: | |
| # | |
| # Author: J. Le Coupanec | |
| # Date: 2014/11/04 |
Gist contains example files for redux-saga user(GET) module. The structure of redux for included files in this gist:
redux
├── user # Module name
│ ├── __tests__ # Directory for redux module tests
│ │ ├── actions.test.js # Action tests
│ │ └── saga.test.js # Saga tests
│ ├── actions.js # Module actions (f/e.: fetchUserRequest, fetchUserSuccess)
│ ├── reducer.js # Module reducer
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
| // src/App.js | |
| import React from 'react'; | |
| import {Provider} from 'react-redux'; | |
| import {ConnectedRouter} from 'react-router-redux'; | |
| import {history} from './history'; | |
| import {store} from './redux/store'; | |
| import {Root} from './components/Root'; | |
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
| There are multiple flattening strategies for observables: | |
| With mergeMap (which has flatMap as an alias), received observables are subscribed to concurrently and their emitted values are flattened into the output stream. | |
| With concatMap, received observables are queued and are subscribed to one after the other, as each completes. (concatMap is mergeMap with a concurrency of one.) | |
| With switchMap, when an observable is received it's subscribed to and any subscription to a previously received observable is unsubscribed. | |
| With exhaustMap, when an observable is received it's subscribed to unless there is a subscription to a previously received observable and that observable has not yet completed - in which case the received observable is ignored. | |
| The concatAll, exhaust, mergeAll and switchAll operators for higher-order observables are implemented using the *Map operators. | |
| --------------------------------------------------------------------------------------------------------------------- |
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 TwitterPackage = require("twitter"); | |
| const DEBUG = process.env.debug; | |
| const secret = { | |
| consumer_key: process.env.consumer_key, | |
| consumer_secret: process.env.consumer_secret, | |
| access_token_key: process.env.access_token_key, | |
| access_token_secret: process.env.access_token_secret | |
| }; |
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
| Get the Service Account and Token. Generate the Kubeconfig | |
| # Update these to match your environment | |
| SERVICE_ACCOUNT_NAME=spinnaker-service-account | |
| CONTEXT=$(kubectl config current-context) | |
| NAMESPACE=spinnaker | |
| NEW_CONTEXT=spinnaker | |
| KUBECONFIG_FILE="kubeconfig-sa" |
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
| #!/bin/bash | |
| if [[ -z "$1" ]] ;then | |
| echo "usage: $0 <username>" | |
| exit 1 | |
| fi | |
| user=$1 | |
| kubectl create sa ${user} | |
| secret=$(kubectl get sa ${user} -o json | jq -r .secrets[].name) |
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
| If you want to forward a non-k8s-managed port and have permission to stand up a new pod, you can run the alpine/socat image and port-forward to that: | |
| kubectl run --restart=Never --image=alpine/socat TEMP_POD_NAME -- -d -d tcp-listen:PORT,fork,reuseaddr tcp-connect:HOSTNAME:PORT | |
| kubectl wait --for=condition=Ready pod/TEMP_POD_NAME | |
| kubectl port-forward pod/TEMP_POD_NAME LOCAL_PORT:PORT | |
| Don't forget to bring the pod down once you're done. | |
| kubectl delete pod/TEMP_POD_NAME --grace-period 1 --wait=false |