Skip to content

Instantly share code, notes, and snippets.

View winkerVSbecks's full-sized avatar
🥵

Varun Vachhar winkerVSbecks

🥵
View GitHub Profile
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,
# 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 ->
@winkerVSbecks
winkerVSbecks / poll.js
Created October 2, 2016 17:45
angular 2 observable polling
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())
var componentData = [{
"id": "0",
"name": "TodoList",
"children": [{
"id": "0.0",
"name": "INPUT"
}, {
"id": "0.1",
"name": "NgIf"
}, {
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
@winkerVSbecks
winkerVSbecks / es6-vs-es5.js
Created January 11, 2016 17:44
es6-vs-es5
// ES5
SomePromise()
.then(function(result) {
return doSomething(result)
})
.catch(function (err) {
console.log(err.message)
});
// ES6
@winkerVSbecks
winkerVSbecks / SassMeister-input.scss
Created May 20, 2015 02:12
Generated by SassMeister.com.
// ----
// 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;
@winkerVSbecks
winkerVSbecks / redis.md
Created March 19, 2015 21:41
Redis stuff

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

@winkerVSbecks
winkerVSbecks / ui.css
Created March 13, 2015 00:51
Browser chrome
.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;
}