Example commands show moving the "data" directory from oldrepo to newrepo and includes all history.
-
Clone a fresh copy of oldrepo.
git clone [email protected]:USERHERE/oldrepo.git
Example commands show moving the "data" directory from oldrepo to newrepo and includes all history.
Clone a fresh copy of oldrepo.
git clone [email protected]:USERHERE/oldrepo.git
-- List all sequences and their current values, excluding system schemas | |
SELECT | |
n.nspname as schema, | |
s.relname as sequence_name, | |
t.relname as table_name, | |
a.attname as column_name, | |
pg_sequence_last_value(s.oid) as last_value | |
FROM pg_class s | |
JOIN pg_namespace n ON n.oid = s.relnamespace | |
JOIN pg_depend d ON d.objid = s.oid |
DO $$ | |
DECLARE | |
i TEXT; | |
BEGIN | |
FOR i IN ( | |
SELECT 'SELECT SETVAL(' | |
|| quote_literal(quote_ident(PGT.schemaname) || '.' || quote_ident(S.relname)) | |
|| ', COALESCE(MAX(' ||quote_ident(C.attname)|| '), 1) ) FROM ' | |
|| quote_ident(PGT.schemaname)|| '.'||quote_ident(T.relname)|| ';' | |
FROM pg_class AS S, |
# Until boto3 adds sync capability, we are stuck with subprocess or module hacks like this. | |
# original author: https://github.com/boto/boto3/issues/358#issuecomment-372086466 | |
import os | |
from awscli.clidriver import create_clidriver | |
def aws_cli(*cmd): | |
old_env = dict(os.environ) | |
try: | |
# Environment | |
env = os.environ.copy() |
A hello world with Clojurescript+shadow-cljs+reagent.
(ns myapp.shutdown-hook | |
(:gen-class)) | |
(defn add-shutdown-hook! | |
"Adds a shutdown hook that executes the given function when the JVM is shutting down." | |
[f] | |
(.addShutdownHook | |
(Runtime/getRuntime) | |
(new Thread ^Runnable f))) |