Skip to content

Instantly share code, notes, and snippets.

Avatar

Mario Martinez martimatix

View GitHub Profile
View .vimrc
syntax on
set hidden
set noerrorbells
set tabstop=2 softtabstop=2
set shiftwidth=2
set expandtab
set smartindent
set nu
set nowrap
@martimatix
martimatix / Elm_Syd_May_2019.md
Last active Mar 24, 2020
Elm Presentation - Compiler Error Messages
View Elm_Syd_May_2019.md

Elm Syd May 2019


News


View updated_at.sql
-- This will automatically update the `updated_at` column on the table `category`
CREATE OR REPLACE FUNCTION update_modified_column()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = now();
RETURN NEW;
END;
$$ language 'plpgsql';
View cargo.toml
[package]
name = "webservice"
version = "0.1.0"
authors = ["Mario Martinez <zenitram.oiram@gmail.com>"]
edition = "2018"
[dependencies]
rocket = "0.4.0"
perfect_numbers = { path = "../perfect-numbers" }
@martimatix
martimatix / Main.elm
Last active Aug 2, 2018
Optional arguments with Graphqelm
View Main.elm
module Main exposing (main)
import Graphqelm.Operation exposing (RootQuery)
import Graphqelm.Http
import Graphqelm.SelectionSet exposing (SelectionSet, with)
import Html exposing (Html, a, div, h1, h2, p, pre, text, img)
import Html.Attributes exposing (src)
import RemoteData exposing (RemoteData)
import Github.Object
import Github.Object.User as User
View atom.cson
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
# Here's an example taken from Atom's built-in keymap:
View checkout.sh
#!/bin/bash
echo "determining branch"
branch=`git branch | sed -e s/^\.\ // | grep $1`
echo "checking out $branch"
git checkout $branch
@martimatix
martimatix / Main.elm
Last active Nov 23, 2018
A beginner's guide to Graphqelm
View Main.elm
module Main exposing (main)
import Graphqelm.Operation exposing (RootQuery)
import Graphqelm.Http
import Graphqelm.SelectionSet exposing (SelectionSet, with)
import Html exposing (Html, a, div, h1, h2, p, pre, text)
import RemoteData exposing (RemoteData)
import Github.Object
import Github.Object.User as User
import Github.Query as Query
View .zshrc
# Path to your oh-my-zsh installation.
export ZSH=/Users/martimatix/.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="robbyrussell"
plugins=(git)
@martimatix
martimatix / fauna_prototype_v1.cr
Last active Mar 18, 2018
Fauna DB syntax prototype
View fauna_prototype_v1.cr
# This backwards approach wouldn't work because things like `let` and `do` would seem unnatural.
Fauna
.index('all_things_random_and_ref')
.match
.paginate(size: size, after: after)
.select('data')
.map { |_, ref| ref.get }
.query