Skip to content

Instantly share code, notes, and snippets.

Matteo Capucci mattecapu

Block or report user

Report or block mattecapu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mattecapu / c_cheatsheet.c
Last active Jan 18, 2017
List of commonly used idioms
View c_cheatsheet.c
// alias type to new_name
typedef type new_name;
// declare an array
int vector[SIZE];
// declare an array, size undetermined
int vector[] = { 3, 4 };
void read_str( char s[] );
// main signature
View library.jsx
export default class Library extends React.Component {
static getFragment() {
return Lokka.getFragment(`
fragment on Library {
render() {
View app.jsx
import Library from '../components/library';
export default class App extends React.Component {
static async getInitialProps() {
return await Lokka.query(`{
libraries {
View lokka_singleton.js
import { Lokka } from 'lokka';
import { Transport } from 'lokka-transport-http';
import { SERVER_URL } from '../config';
/* singleton Lokka client */
export default new Lokka({
transport: new Transport(`${SERVER_URL}/graphql`)
View .babelrc
"presets": [
View build.json
"start": "node dist/server.js",
"clean": "rm -rf dist",
"prebuild": "npm run clean && mkdir dist && cp -r src/** dist/",
"build": "babel src --ignore pages/*,components/* -d dist && next build dist",
yarn add koa@2 koa-graphql koa-router@next koa-convert --exact
yarn add graphql lokka lokka-transport-http --exact
yarn add sequelize pg pg-hstore --exact
mkdir libradar
cd libradar
git init
yarn init
yarn add next --exact
mkdir pages components
You can’t perform that action at this time.