Skip to content

Instantly share code, notes, and snippets.

@namjae
namjae / postgres-cheatsheet.md
Created November 25, 2016 09:51 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

@namjae
namjae / server.ex
Created June 19, 2017 11:56 — forked from prio/server.ex
Elixir gen_server example
defmodule Tcprpc.Server do
use GenServer.Behaviour
defrecord State, port: nil, lsock: nil, request_count: 0
def start_link(port) do
:gen_server.start_link({ :local, :tcprcp }, __MODULE__, port, [])
end
def start_link() do

The Why and When of Choosing Elm

What is Elm?

  • Language (and "framework") for building web frontend applications
  • Can be used in place of HTML, CSS and JavaScript
  • Compiles into the above
@namjae
namjae / CMakeLists.txt
Created March 9, 2018 06:45
example cmake with ROS and Qt
##############################################################################
# CMake
##############################################################################
cmake_minimum_required(VERSION 2.8.0)
project(show_laser)
##############################################################################
# Catkin
##############################################################################
@namjae
namjae / Phoenix JWT.md
Created July 5, 2018 05:20 — forked from nikneroz/Phoenix JWT.md
Elixir + Phoenix Framework 1.3 + Guardian + JWT(Refresh, Revoke, Recover) + Comeonin

Elixir + Phoenix Framework 1.3 + Guardian + JWT(Refresh, Revoke, Recover) + Comeonin

User model bootstrap

Let's generate User model and controller.

mix ecto.create
mix phoenix.gen.json Accounts User users email:string password_hash:string

Asciidoc 으로 전자책 쓰기 - SpringCamp 2016 LETS


@namjae
namjae / GitHub Flavored Asciidoc (GFA).adoc
Created July 30, 2018 09:19 — forked from dcode/GitHub Flavored Asciidoc (GFA).adoc
Demo of some useful tips for using Asciidoc on GitHub

GitHub Flavored Asciidoc (GFA)

@namjae
namjae / change-ubuntu-mirror.sh
Last active June 21, 2019 07:51 — forked from lesstif/change-ubuntu-mirror.sh
우분투의 apt 기본 미러를 다음 카카오로 변경
#!/bin/sh
##
sed -i -e 's/\(us.\)\?archive.ubuntu.com/ftp.daumkakao.com/g' -e 's/security.ubuntu.com/ftp.daumkakao.com/g' /etc/apt/sources.list
## check
apt update
##
## LeoFS' Erlang
##
FROM gliderlabs/alpine:3.4
MAINTAINER LeoFS <leo-project.net/leofs/>
ENV LANG=en_US.UTF-8 \
HOME=/var/local/erlang/ \
TERM=xterm
@namjae
namjae / ubuntu1804_ruby_elixir.md
Created May 22, 2019 03:06 — forked from brycejohnston/ubuntu1804_ruby_elixir.md
Ubuntu 18.04 / 18.10 Ruby and Elixir Development Setup

Ubuntu 18.04 / 18.10 Ruby and Elixir Development Setup

Guide to setting up a new Ubuntu 18.04 dev environment with Ruby and Elixir installed with the asdf version management tool.

Update system and install prerequisite packages

Some of these packages may already be installed

sudo apt-get install make binutils gcc build-essential \
 git curl zlib1g-dev openssl libssl-dev libreadline-dev \