This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let uuidGenerationRaw = connection.client.config.client === 'sqlite3' ? | |
`(lower(hex(randomblob(4))) || '-' || lower(hex(randomblob(2))) || '-4' || substr(lower(hex(randomblob(2))),2) || '-' || substr('89ab',abs(random()) % 4 + 1, 1) || substr(lower(hex(randomblob(2))),2) || '-' || lower(hex(randomblob(6))))` : | |
`uuid_generate_v4()`; | |
connection.schema.createTableIfNotExists('notification', (table) => { | |
table.uuid('id').primary().defaultTo(connection.raw(uuidGenerationRaw)); | |
// ... rest of the columns | |
}), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var source = require('vinyl-source-stream'); | |
var gulp = require('gulp'); | |
var gutil = require('gulp-util'); | |
var browserify = require('browserify'); | |
var reactify = require('reactify'); | |
var watchify = require('watchify'); | |
var notify = require("gulp-notify"); | |
var scriptsDir = './scripts'; | |
var buildDir = './build'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS hstore;'" | |
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";'" | |
sudo su - postgres -c "service postgresql stop" | |
sudo su - postgres -c '/usr/lib/postgresql/9.4/bin/pg_upgrade -b /usr/lib/postgresql/9.3/bin -B /usr/lib/postgresql/9.4/bin -d /var/lib/postgresql/9.3/main/ -D /var/lib/postgresql/9.4/main/ -o "-c config_file=/etc/postgresql/9.3/main/postgresql.conf" -O "-c config_file=/etc/postgresql/9.4/main/postgresql.conf"' | |
sudo apt-get remove postgresql-9.3 -y | |
sudo sed -i "s:5433:5432:g" /etc/postgresql/9.4/main/postgresql.conf | |
sudo service postgresql restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -H -u postgres /usr/lib/postgresql/9.3/bin/pg_upgrade \ | |
-b /usr/lib/postgresql/9.1/bin \ | |
-B /usr/lib/postgresql/9.3/bin \ | |
-d /var/lib/postgresql/9.1/main \ | |
-D /var/lib/postgresql/9.3/main \ | |
-o ' -c config_file=/etc/postgresql/9.1/main/postgresql.conf' \ | |
-O ' -c config_file=/etc/postgresql/9.3/main/postgresql.conf' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./configure \ | |
--prefix=/usr/share/nginx \ | |
--sbin-path=/usr/sbin/nginx \ | |
--conf-path=/etc/nginx/nginx.conf \ | |
--pid-path=/var/run/nginx.pid \ | |
--lock-path=/var/lock/nginx.lock \ | |
--error-log-path=/var/log/nginx/error.log \ | |
--http-log-path=/var/log/access.log \ | |
--user=www-data \ | |
--group=www-data \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Blog running on Ghost in Nodejs | |
server { | |
listen 80; | |
server_name blog.shernshiou.com; | |
#access_log /var/log/nginx/log/blog.access.log; | |
client_max_body_size 5M; | |
location / { | |
proxy_pass http://LOCALHOST:GHOST_PORT/; | |
proxy_set_header Host $host; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Recursive function that add a+1 until it reach 10 | |
int myFunction(int a) | |
{ | |
if(myFunction(a+1) > 10) | |
return a; | |
} |