Skip to content

Instantly share code, notes, and snippets.

fragment DescribeHero on Character {
name
appearsIn
}
// ...
import {graphql} from 'react-apollo';
const graphqlDocuments = require('./documents.json');
// ...
const FeedWithData = graphql(graphqlDocuments['Feed.graphql'])(Feed);
// ...
graphql-document-collector '**/*.graphql' > documents.json
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@rricard
rricard / index.html
Last active August 29, 2015 14:03
Reactive AnyFetch
<html>
<head>
<title>Reactive AnyFetch</title>
<script src="http://fb.me/react-0.10.0.js"></script>
<script src="http://fb.me/JSXTransformer-0.10.0.js"></script>
<script type="text/jsx" src="./search-box.jsx"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/superagent/0.15.7/superagent.min.js"></script>
</head>
<body>
<div id="content"></div>
@rricard
rricard / amuse.zsh-theme
Created October 3, 2013 14:56
Amuse zsh theme (not by me)
# vim:ft=zsh ts=2 sw=2 sts=2
rvm_current() {
rbenv version 2>/dev/null
}
PROMPT='
%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%}
$ '
@rricard
rricard / Stacktrace
Last active December 20, 2015 15:48
Stacktrace
$ vagrant provision
[Berkshelf] This version of the Berkshelf plugin has not been fully tested on this version of Vagrant.
[Berkshelf] You should check for a newer version of vagrant-berkshelf.
[Berkshelf] If you encounter any errors with this version, please report them at https://github.com/RiotGames/vagrant-berkshelf/issues
[Berkshelf] You can also join the discussion in #berkshelf on Freenode.
[Berkshelf] Updating Vagrant's berkshelf: '/Users/rricard/.berkshelf/default/vagrant/berkshelf-20130805-21507-1x6hor0-default'
[Berkshelf] Using cluestr-ops (0.1.0)
[Berkshelf] Using apt (1.9.2)
[Berkshelf] Using git (2.5.0)
@rricard
rricard / papiel-reader.js
Last active December 19, 2015 07:09
A sample Papiel reader written in pure node.js
#!/bin/node
/**
* Launch with `node papiel-reader.js`
*/
var http = require('http'),
https = require('https'),
fs = require('fs'),
url = require('url');
@rricard
rricard / Error stack trace
Created August 10, 2012 01:58
Path config fallback for RequireJS compilation error
Error: Error: ENOENT, no such file or directory 'RAILS_ROOT/tmp/assets/http:/cdnjs.cloudflare.com/ajax/libs/zepto/1.0rc1/zepto.min,zepto.js'
at Object.fs.openSync (fs.js:338:18)
at build (/usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/requirejs-rails-0.9.0/bin/r.js:14166:23)
at requirejs.optimize.runBuild (/usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/requirejs-rails-0.9.0/bin/r.js:15358:30)
at Object.context.execCb (/usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/requirejs-rails-0.9.0/bin/r.js:1773:33)
at Object.Module.check (/usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/requirejs-rails-0.9.0/bin/r.js:1083:51)
at Object.Module.enable (/usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/requirejs-rails-0.9.0/bin/r.js:1324:22)
at Object.Module.init (/usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/requirejs-rails-0.9.0/bin
@rricard
rricard / .zshrc
Created March 8, 2012 13:10
My ZSHrc
#! /bin/zsh
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="rricard"