Skip to content

Instantly share code, notes, and snippets.

View mz026's full-sized avatar

Yang-Hsing Lin mz026

View GitHub Profile
@mz026
mz026 / read-access.sql
Created May 23, 2021 13:59 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@mz026
mz026 / pre-commit
Last active August 29, 2015 14:15 — forked from avolkov/pre-commit
#!/bin/sh
###
# Strip whitespaces and convert to Unix newlines.
# Source: http://stackoverflow.com/a/3516525/86294
# Save this file into git config directory as .git/hooks/pre-commit
###
if git-rev-parse --verify HEAD >/dev/null 2>&1 ; then
against=HEAD
else
@import "compass/utilities/sprites/base";
// General Sprite Defaults
// You can override them before you import this file.
$icon-sprite-base-class: ".icon-sprite" !default;
$icon-sprite-dimensions: false !default;
$icon-position: 0% !default;
$icon-spacing: 0 !default;
$icon-repeat: no-repeat !default;

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@mz026
mz026 / city.rb
Last active December 28, 2015 02:29 — forked from sumskyi/README.md
class City < GeoEntity
end
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {