Skip to content

Instantly share code, notes, and snippets.

View rngadam's full-sized avatar
💭
coderbunker.ca

Ricky Ng-Adam rngadam

💭
coderbunker.ca
View GitHub Profile
9.799084] EXT4-fs (mmcblk0p6): mounted filesystem with ordered data mode. Opts: errors=remount-ro,nomblk_io_submit
[ 10.121956] e2fsck: e2fsck 1.44.4 (18-Aug-2018)
[ 10.121956]
[ 10.128336] e2fsck: Pass 1: Checking inodes, blocks, and sizes
[ 10.128336]
[ 10.135974] e2fsck: Pass 2: Checking directory structure
[ 10.135974]
[ 10.142907] e2
@rngadam
rngadam / .tmux.conf
Created February 9, 2020 18:34
tmux configuration
set -g history-limit 50000
setw -g mode-keys vi
@rngadam
rngadam / .gitconfig
Created September 7, 2018 03:12
git configuration from rngadam-mac
[user]
name = Ricky Ng-Adam
email = [email protected]
[alias]
st = status
ci = commit
co = checkout
br = branch
ss = status -sb
ll = log --oneline --decorate
{
"default_size" : 0.142,
"tags" : [
{
"ID": 0,
"position": [ 1.4, 0, -1 ],
"rotation": [ 0, 5, 0 ],
"size": 0.1
},
{
# using SendGrid's Python Library
# https://github.com/sendgrid/sendgrid-python
import sendgrid
import os
from sendgrid.helpers.mail import *
import xlrd
def sendEmail(emailAddress):
sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
DROP SCHEMA IF EXISTS design CASCADE;
CREATE SCHEMA IF NOT EXISTS design;
CREATE TABLE IF NOT EXISTS design.event(
id uuid DEFAULT uuid_generate_v4() PRIMARY KEY,
name TEXT
);
*** /Users/rngadam/coderbunker/src/pgddl/test/expected/type.out 2018-04-18 10:45:57.000000000 +0800
--- /Users/rngadam/coderbunker/src/pgddl/results/type.out 2018-04-18 10:46:20.000000000 +0800
***************
*** 128,134 ****
);
COMMENT ON TYPE integer IS '-2 billion to 2 billion integer, 4-byte storage';
! ALTER TYPE integer OWNER TO postgres;
END;
-- expect this to work but it doesn't...
CREATE OR REPLACE FUNCTION create_update_enum(schemaname TEXT, typname TEXT, enum_values text[]) RETURNS SETOF TEXT AS
$$
DECLARE
has_type BOOLEAN;
label text[];
BEGIN
SELECT count(*) = 1 INTO has_type
FROM pg_type
*** /Users/rngadam/coderbunker/prj/scryinfo/pgddl/test/expected/type.out 2018-03-31 09:38:34.000000000 +0800
--- /Users/rngadam/coderbunker/prj/scryinfo/pgddl/results/type.out 2018-03-31 09:38:44.000000000 +0800
***************
*** 128,134 ****
);
COMMENT ON TYPE integer IS '-2 billion to 2 billion integer, 4-byte storage';
! ALTER TYPE integer OWNER TO postgres;
END;
CREATE OR REPLACE function safe_cast(text,anyelement)
returns anyelement
language plpgsql as $$
begin
$0 := $1;
return $0;
exception when others then
return $2;
end; $$;