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
docker rmi -f $(docker images --format "{{.ID}} {{.Repository}}" | grep <name to search> | awk ' {print $1} ') |
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
const { Map, List } = require('immutable'); | |
const mapBeforeI = Map({ a: 1, b: List([1, 2]) }); | |
// First let's experiment with an Immutable structure | |
// Perform set operation, but make the values the same | |
const mapAfterI = mapBeforeI.set('a', 1); | |
console.log(mapBeforeI === mapAfterI); // true | |
// Perform set operation, but make the values different |
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
/** | |
* This file provides type definitions for use with the Flow type checker. | |
* | |
* An important caveat when using these definitions is that the types for | |
* `Collection.Keyed`, `Collection.Indexed`, `Seq.Keyed`, and so on are stubs. | |
* When referring to those types, you can get the proper definitions by | |
* importing the types `KeyedCollection`, `IndexedCollection`, `KeyedSeq`, etc. | |
* For example, | |
* | |
* import { Seq } from 'immutable' |
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 from 'react'; | |
import css from './OpacityAnimation.css'; | |
import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; | |
const OpacityAnimation = ({ children }) => ( | |
<ReactCSSTransitionGroup | |
transitionName={css.opacityTransition} | |
transitionAppear | |
transitionEnter | |
transitionLeave |
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
/* placeholder for named import */ | |
.opacityTransition {}; | |
.opacityTransition-appear { | |
opacity: 0; | |
} | |
.opacityTransition-appear.opacityTransition-appear-active { | |
opacity: 1; | |
/* autoprefix transition as needed */ |
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 OpacityAnimation from './OpacityAnimation.jsx'; | |
const Example = ({ showBox }) => ( | |
<OpacityAnimation> | |
{showBox | |
? <div | |
key="Example" | |
style={{ | |
backgroundColor: 'red', | |
height: '30px', |
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
"""Implement quick sort in Python. | |
Input a list. | |
Output a sorted list.""" | |
def sort_slice(list_slice): | |
# pivot location always starts on the right | |
end_idx = len(list_slice) - 1 | |
pivot_idx = end_idx | |
# compare location always starts on the left | |
compare_idx = 0 | |
while(True): |
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
"""Implement a function recursively to get the desired | |
Fibonacci sequence value. | |
Your code should have the same input/output as the | |
iterative code in the instructions.""" | |
prev1 = 0 | |
prev2 = 1 | |
count = 0 | |
def recursive(prev1, prev2, count, terminal): |
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
# Find a string within a string and return the found index | |
# Found index will be -1 if string not found | |
def substring(strToSearch, strToFind): | |
totalLength = len(strToSearch) | |
findLength = len(strToFind) | |
for idx in range(0, totalLength): | |
if (strToSearch[idx:idx + findLength] == strToFind): | |
return idx |
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
// This file doesn't go through babel or webpack transformation. | |
// Make sure the syntax and sources this file requires are compatible with the current node version you are running | |
// See https://github.com/zeit/next.js/issues/1245 for discussions on Universal Webpack or universal Babel | |
const { createServer } = require('http') | |
const express = require('express') | |
const { parse } = require('url') | |
const next = require('next') | |
const path = require('path'); | |
const dev = process.env.NODE_ENV !== 'production' |
OlderNewer