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 / postgresql conenxtion refused fix
Created May 25, 2015 23:24
PG Connection refused postgres pgsql brew fix
rm /usr/local/var/postgres/postmaster.pid
@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
@batamire
batamire / passenger standalone start
Last active August 29, 2015 14:15
start passenger deployed with capistrano
bundle exec passenger start \
--daemonize \
--port 300x \
--environment production \
--pid-file /home/xxx/apps/xxx/shared/tmp/pids/passenger.300x.pid \
--log-file /home/xxx/apps/xxx/shared/log/passenger.300x.log \
--temp-dir=/home/xxx/apps/xxx/shared/tmp \
/home/xxx/apps/xxx/current
@batamire
batamire / devise.sr.yml
Created May 30, 2012 17:24
Devise 2.1 srpski prevod - ћирилица
sr:
errors:
messages:
expired: "је истекао, молимо затражите нови"
not_found: "није нађено"
already_confirmed: "је већ потврђено, покушајте да се пријавите"
not_locked: "није закључано"
not_saved:
one: "1 грешка спречава снимање %{resource}:"
few: "%{count} грешке спречавају снимање %{resource}:"