Skip to content

Instantly share code, notes, and snippets.

View noppolp's full-sized avatar

noppolp noppolp

View GitHub Profile
@noppolp
noppolp / rails-server-config
Last active August 29, 2015 14:11
Config environment for rails server
############################################
# Environment
############################################
# production
#
# $ sudo nano /etc/environment
# --------------------------------------------------
# export RAILS_ENV=production
# export RACK_ENV=production
# --------------------------------------------------
@noppolp
noppolp / php-on-nginx
Last active August 29, 2015 14:11
Install PHP on nginx
### PhpMyAdmin (by different root)
$ sudo apt-get install php5-mysql phpmyadmin
$ sudo apt-get install php5-fpm
$ sudo nano /etc/nginx/sites-available/default
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
@noppolp
noppolp / rails-commands
Created December 11, 2014 05:49
Common Rails commands
# create migration file
$ rails generate migration AddPartNumberToProducts
@noppolp
noppolp / safe-clear-log
Created January 13, 2015 11:26
safe clear log
echo " " > /var/www/app/current/log/production.log
@noppolp
noppolp / rmagick-install
Created January 16, 2015 14:43
Cannot install rmagick
http://stackoverflow.com/questions/16376010/ubuntu-cannot-install-rmagick
apt-get install libmagickwand-dev
@noppolp
noppolp / rails_env_nginx
Last active August 29, 2015 14:14
Add more one rails env to nginx
$ cp /etc/nginx/sites-available/default /etc/nginx/sites-available/staging
$ ln -s /etc/nginx/sites-available/staging /etc/nginx/sites-enabled/staging
$ nano /etc/nginx/sites-available/staging
server {
listen 80;
listen [::]:80;
.filter("timeago", function () {
//time: the time
//local: compared to what time? default: now
//raw: wheter you want in a format of "5 minutes ago", or "5 minutes"
return function (time, local, raw) {
if (!time) return "never";
if (!local) {
(local = Date.now())
}
@noppolp
noppolp / winmysql2gem
Created February 26, 2015 03:03
mysql2 gem on windows
# Download link: http://dev.mysql.com/downloads/connector/c/
gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:\mysql-connector"'
@noppolp
noppolp / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@noppolp
noppolp / smoothstream.xml
Created May 9, 2015 11:13
Smooth Streaming Package.appxmanifest
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">
....
<Extensions>
<Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>