Instantly share code, notes, and snippets.

# Matteo Capuccimattecapu

• Sort options
Last active Jun 22, 2019
Proof of equivalence for two definitions of sum.
View equiv_of_sums.lagda
 # Proof of equivalence for two definitions of sum \begin{code} module equiv_of_sums where import Relation.Binary.PropositionalEquality as Eq open Eq using (_≡_; refl; cong; sym) open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _≡⟨_⟩_; _∎) data ℕ : Set where
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
Created Jan 11, 2017
View library.jsx
 export default class Library extends React.Component { static getFragment() { return Lokka.getFragment( fragment on Library { name } ); } render() {
Last active Jan 11, 2017
View app.jsx
 import Library from '../components/library'; export default class App extends React.Component { static async getInitialProps() { return await Lokka.query({ libraries { id, ...${Library.getFragment()} } }); Last active Jan 11, 2017 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) });
Created Jan 10, 2017
View .babelrc
 { "presets": [ "next/babel" ] }
Created Jan 10, 2017
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",
Last active Jan 9, 2017
View koa.sh
 yarn add koa@2 koa-graphql koa-router@next koa-convert --exact
Created Jan 9, 2017
View graphql.sh
 yarn add graphql lokka lokka-transport-http --exact
Last active Jan 6, 2017
View seq.sh
 yarn add sequelize pg pg-hstore --exact
You can’t perform that action at this time.