Skip to content

Instantly share code, notes, and snippets.

Avatar
🤘
Design Systems 4 lyfe

Rob Phoenix robphoenix

🤘
Design Systems 4 lyfe
View GitHub Profile
View gist:452e2e748a2a990ed5b8838861eafc12
s = status --short --branch --ignore-submodules=untracked
find = log --pretty=\"format:%Cgreen%H\n%s\n\n%b\" --name-status --grep
amend = commit --amend --no-edit
undo = reset HEAD~
upload = "!git push rakyll $(git rev-parse --abbrev-ref HEAD)"
prune = "!git co master && git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
delete = branch -D
pr = "!git fetch origin pull/$1/head:pr$1"
sync = "!git pull -q -r origin master"
@danidiaz
danidiaz / netrw.txt
Created Oct 7, 2016
Vim's netrw commands.
View netrw.txt
--- ----------------- ----
Map Quick Explanation Link
--- ----------------- ----
< <F1> Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file |netrw-cr|
<del> Netrw will attempt to remove the file/directory |netrw-del|
<c-h> Edit file hiding list |netrw-ctrl-h|
<c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
<c-r> Browse using a gvim server |netrw-ctrl-r|
<c-tab> Shrink/expand a netrw/explore window |netrw-c-tab|
@pauldambra
pauldambra / checkout-kata.exs
Created Dec 29, 2015
the checkout kata in elixir
View checkout-kata.exs
defmodule Checkout do
defstruct [
basket: %{A: 0, B: 0, C: 0, D: 0}
]
def scan(checkout, code) do
new_value = checkout.basket[code] + 1
%{checkout | basket: Map.put(checkout.basket, code, new_value)}
end
@ivanbatic
ivanbatic / typescript-async-await-demo.ts
Last active Jan 12, 2021
Typescript async/await demo
View typescript-async-await-demo.ts
"use strict";
class Cheese {
private state = "hard";
public async melt() {
console.log("Melting...");
return new Promise((resolve) => {
setTimeout(() => {
this.state = "melted";
@jonathanpmartins
jonathanpmartins / install-libsodium.sh
Last active Jul 28, 2019
Install Libsodium on Ubuntu 14.04.3 LTS Trusty
View install-libsodium.sh
#!/bin/bash
sudo add-apt-repository ppa:chris-lea/libsodium;
sudo echo "deb http://ppa.launchpad.net/chris-lea/libsodium/ubuntu trusty main" >> /etc/apt/sources.list;
sudo echo "deb-src http://ppa.launchpad.net/chris-lea/libsodium/ubuntu trusty main" >> /etc/apt/sources.list;
sudo apt-get update && sudo apt-get install libsodium-dev;
@kotakanbe
kotakanbe / ipcalc.go
Created Sep 17, 2015
get all IP address from CIDR in golang
View ipcalc.go
package main
import (
"net"
"os/exec"
"github.com/k0kubun/pp"
)
func Hosts(cidr string) ([]string, error) {
@maxcap
maxcap / Eloquent Javascript Exercise Answers
Last active Feb 27, 2019
Eloquent Javascript Book: Exercise Answers
View Eloquent Javascript Exercise Answers
/*
These are my attempts at the exercises in the book Eloquent Javascript
http://eloquentjavascript.net
*/
@PHLAK
PHLAK / build.json
Created Nov 13, 2014
Packer QEMU / KVM example.
View build.json
{
"variables": {
"ssh_user": "root",
"ssh_pass": "T@c0_Bu3n0"
},
"builders": [
{
@john2x
john2x / 00_destructuring.md
Last active Sep 3, 2022
Clojure Destructuring Tutorial and Cheat Sheet
View 00_destructuring.md

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@bsag
bsag / .vimrc
Last active Oct 20, 2018
My vim and tmux configs, using airline (as discussed [here](http://www.rousette.org.uk/blog/archives/tinkering-with-vim/). The Powerline theme is pretty much the default (may be a bit old now) and I just commented out a few plugins I didn't need. I use the patched Sauce Code Pro for my powerline/airline font.
View .vimrc
" Set up Vundle to manage plugins
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle, required
Plugin 'gmarik/vundle'