Skip to content

Instantly share code, notes, and snippets.

Avatar
🏎️
(☞゚ヮ゚)☞ ☜(゚ヮ゚☜)

Taz Singh tazsingh

🏎️
(☞゚ヮ゚)☞ ☜(゚ヮ゚☜)
View GitHub Profile
@tazsingh
tazsingh / subscribeTo_extension.graphql
Created May 26, 2017
Fragment Subscriptions - subscribeTo Extension Approach
View subscribeTo_extension.graphql
fragment userFragment on User
subscribeTo(userAvatarChangeSubscription)
{
name
username
avatarUrl(size: 200)
avatarChangeId # can be an implicit field on this fragment added by
# the server to track subscription events on the client
}
@tazsingh
tazsingh / directive_approach.graphql
Last active May 26, 2017
Fragment Subscriptions - Directive Approach
View directive_approach.graphql
fragment userFragment on User
@subscribeTo(name: "avatarChange", with: avatarChangeFragment)
{
name
username
avatarUrl(size: 200)
avatarChangeId # can be an implicit field on this fragment added by
# the server to track subscription events on the client
}
@tazsingh
tazsingh / output.sh
Created Apr 4, 2017
Ejecting `create-react-native-app` files
View output.sh
~/Code > create-react-native-app brohan-test
Creating a new React Native app in /Users/taz/Code/brohan-test.
Installing packages. This might take a couple minutes.
Installing react-native-scripts...
yarn add v0.20.3
info No lockfile found.
[1/4] 🔍 Resolving packages...
warning react-native-scripts > xdl > node-uuid@1.4.8: Use uuid module instead
@tazsingh
tazsingh / main.js
Created Jan 25, 2016
incremental-redux-reducers example app (not tested)
View main.js
import {createStore, applyMiddleware, combineReducers} from "redux";
import thunk from "redux-thunk";
import {setupIncrementalReduxReducers, reducerStore} from "incremental-redux-reducers";
// Create the store however you like.
// For example purposes, let's apply the thunk middleware.
const createStoreWithMiddleware = applyMiddleware(
thunk
)(createStore);
@tazsingh
tazsingh / gist:ec75a4ce0e18b3d6f51a
Created Aug 11, 2015
No Async APIs in the core JavaScript language
View gist:ec75a4ce0e18b3d6f51a
> d8
V8 version 3.30.33.16 [console: readline]
d8> typeof setTimeout
undefined
d8> typeof console
undefined
d8> print("Probably not what you're used to!")
Probably not what you're used to!
@tazsingh
tazsingh / gist:8391d29139c27a6bac85
Created Apr 23, 2015
Isomorphic Full Stack ES2015 Hot Flux Generators on io.js
View gist:8391d29139c27a6bac85
Isomorphic Full Stack
ES2015 Hot Flux Generators
on io.js
@tazsingh
tazsingh / gist:386c1ecb47ad72663774
Created Apr 13, 2015
Pry suppress output behaviour
View gist:386c1ecb47ad72663774
[1] pry(main)> class Foo
[1] pry(main)* def inspect
[1] pry(main)* binding.pry
[1] pry(main)* end
[1] pry(main)* end
=> nil
[2] pry(main)> Foo.new
=> ERROR: Pry started inside Pry.
This can happen if you have a binding.pry inside a #to_s or #inspect function.
#<Foo:0x1f4e>
View gist:1ec53ff5a8462f24f0e3
~ 2.0.0-p247> brew remove mongodb
Uninstalling /usr/local/Cellar/mongodb/2.6.7...
mongodb 2.4.10, 2.4.9, 2.6.0_1, 2.6.1, 2.6.5, 2.6.6 are still installed.
Remove them all with `brew uninstall --force mongodb`.
~ 2.0.0-p247> brew uninstall --force mongodb
Uninstalling mongodb...
~ 2.0.0-p247>
@tazsingh
tazsingh / gist:6ebfcab592fc3577680f
Created Jan 9, 2015
JavaScript `print` vs `console.log`
View gist:6ebfcab592fc3577680f
$> d8
V8 version 3.25.30 [console: readline]
d8> typeof console
undefined
d8> typeof print
function
d8> print("hello world")
hello world
d8> console.log("hello world")
(d8):1: ReferenceError: console is not defined
View gist:6369694
> ping github.com
PING github.com (204.232.175.90): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
Request timeout for icmp_seq 7