Skip to content

Instantly share code, notes, and snippets.

@batamire
batamire / README.md
Created October 25, 2018 23:17 — forked from notheotherben/README.md
Fix Postgres 9.x Sequences

PostgreSQL 9.x Sequence Fixing Script

This script is intended to automatically fix the sequence numbers for all tables in the current database.

This is accomplished through the use of the setval() command, which we provide with the next ID value we wish to make use of. We use the setval(sequence, number, is_called) overload and set is_called = false in conjunction with COALESCE(MAX + 1, 1) to ensure that, with an empty table, the next sequence value is 1 as expected.

@batamire
batamire / keybindings.json.yaml
Last active October 18, 2016 14:04 — forked from mohsen1/keybindings.json.yaml
Sublime Text key bindings for Visual Studio Code
[
// sublime keybindings
{
"key": "cmd+shift+[",
"command": "workbench.action.previousEditor"
},
{
"key": "cmd+shift+]",
"command": "workbench.action.nextEditor"
},
@batamire
batamire / nginx gzip
Last active August 29, 2015 14:24 — forked from zhuangya/gist:8399374
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/xml text/css text/javascript text/x-js application/json application/javascript application/x-javascript application/xml application/xml+rss;
@batamire
batamire / gist:527cd07ef56023def901
Last active August 29, 2015 14:21 — forked from ikr/gist:875875
Add user to _www group on Mac OS X
sudo dseditgroup -o edit -a username -t user _www