Skip to content

Instantly share code, notes, and snippets.

View tazsingh's full-sized avatar
🏎️
(☞゚ヮ゚)☞ ☜(゚ヮ゚☜)

Taz Singh tazsingh

🏎️
(☞゚ヮ゚)☞ ☜(゚ヮ゚☜)
View GitHub Profile
@tazsingh
tazsingh / subscribeTo_extension.graphql
Created May 26, 2017 15:49
Fragment Subscriptions - subscribeTo Extension Approach
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 15:11
Fragment Subscriptions - Directive Approach
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 April 4, 2017 19:41
Ejecting `create-react-native-app` files
~/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 January 25, 2016 04:02
incremental-redux-reducers example app (not tested)
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 August 11, 2015 14:56
No Async APIs in the core JavaScript language
> 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 April 23, 2015 02:40
Isomorphic Full Stack ES2015 Hot Flux Generators on io.js
Isomorphic Full Stack
ES2015 Hot Flux Generators
on io.js
@tazsingh
tazsingh / gist:386c1ecb47ad72663774
Created April 13, 2015 17:32
Pry suppress output behaviour
[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>
~ 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 January 9, 2015 19:41
JavaScript `print` vs `console.log`
$> 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
> 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