A Pen by Varun Vachhar on CodePen.
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
import R from 'ramda'; | |
const actionType = value => R.compose( | |
R.equals(value), | |
R.propOr(undefined, 'type'), | |
R.nthArg(1), | |
); | |
const reducerConds = R.compose( | |
R.cond, |
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
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
Rx.Observable | |
.interval(500) | |
.flatMap(() => [1, 2, 3] /* in angular you will call getData() to make an HTTP request */) | |
.map(x => x + 1) | |
.subscribe(x => console.log(x)) | |
function getData() { | |
return this.http | |
.get('https://api.spotify.com/v1/search?q=' + term + '&type=artist') | |
.map((response) => response.json()) |
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
var componentData = [{ | |
"id": "0", | |
"name": "TodoList", | |
"children": [{ | |
"id": "0.0", | |
"name": "INPUT" | |
}, { | |
"id": "0.1", | |
"name": "NgIf" | |
}, { |
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
apply plugin: "com.android.application" | |
import com.android.build.OutputFile | |
/** | |
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets | |
* and bundleReleaseJsAndAssets). | |
* These basically call `react-native bundle` with the correct arguments during the Android build | |
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the | |
* bundle directly from the development server. Below you can see all the possible configurations |
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
// ES5 | |
SomePromise() | |
.then(function(result) { | |
return doSomething(result) | |
}) | |
.catch(function (err) { | |
console.log(err.message) | |
}); | |
// ES6 |
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
// ---- | |
// Sass (v3.4.13) | |
// Compass (v1.0.3) | |
// ---- | |
@mixin btn-gen($bg, $color, $border, $hover-bg, $hover-border, $hover-color) { | |
background-color: $bg; | |
color: $color; | |
border: 1px solid $border; |
To have launchd start redis at login:
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
Then to load redis now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
Or, if you don't want/need launchctl, you can just run:
redis-server /usr/local/etc/redis.conf
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
.fake-browser-ui { | |
padding: 20px 0 0; | |
border-radius: 3px; | |
border-bottom: 2px solid #ccc; | |
background: #ddd; | |
display: inline-block; | |
position: relative; | |
line-height: 0; | |
} |