Skip to content

Instantly share code, notes, and snippets.

@namjae
namjae / test1.sql
Created May 30, 2016 01:13
regex (SQL 주석 제거)
import java.io.BufferedReader;
import java.io.FileReader;
public class Test {
public static void main(String[] args) {
String PATTERN_COMMENT = "/\\*([^*]|[\r\n]|(\\*+([^*/]|[\r\n])))*\\*+/";
try {
# If there is no version tag in git this one will be used
VERSION = 0.1.0
# Need to discard STDERR so get path to NULL device
win32 {
NULL_DEVICE = NUL # Windows doesn't have /dev/null but has NUL
} else {
NULL_DEVICE = /dev/null
}
@namjae
namjae / schema.sql
Created August 18, 2016 06:11 — forked from fernandomantoan/schema.sql
Schema for PostgreSQL to use with JdbcTokenStore (Spring Security OAuth2)
create table oauth_client_details (
client_id VARCHAR(256) PRIMARY KEY,
resource_ids VARCHAR(256),
client_secret VARCHAR(256),
scope VARCHAR(256),
authorized_grant_types VARCHAR(256),
web_server_redirect_uri VARCHAR(256),
authorities VARCHAR(256),
access_token_validity INTEGER,
refresh_token_validity INTEGER,
@namjae
namjae / elixir_cheat_sheet.md
Created November 11, 2016 03:45
elixir cheat sheet
@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 / asdf.linux.sh
Last active March 27, 2017 03:00
my initial asdf setup script on linux
#!/bin/bash
# ref: https://github.com/asdf-vm/asdf
sudo apt-get install -y automake autoconf libreadline-dev libncurses-dev libssl-dev libyaml-dev libxslt-dev libffi-dev libtool unixodbc-dev
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.2.1
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc
asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf plugin-add elm https://github.com/vic/asdf-elm.git
asdf plugin-add nodejs https://github.com/asdf-vm/asdf-nodejs.git
@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
#!/bin/bash
sudo apt update
sudo apt upgrade -y
# basic developement setup
sudo apt install git git-flow emacs
git clone https://github.com/purcell/emacs.d ~/.emacs.d
# asdf setup
@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
##############################################################################