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
# Be sure to save your config files. Optional but I do: | |
sudo cp /etc/postgresql/9.3/main/postgresql.conf ~ | |
sudo cp /etc/postgresql/9.3/main/pg_hba.conf ~ | |
# Also probably optional but I like to update sources and upgrade | |
sudo apt-get update | |
sudo apt-get upgrade | |
# Install postgres 9.4 | |
sudo apt-get update |
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
1. Install Linux updates, set time zones, followed by GCC and Make | |
sudo yum -y update | |
sudo ln -sf /usr/share/zoneinfo/America/Indianapolis \ | |
/etc/localtime | |
sudo yum -y install gcc make | |
2. Download, Untar and Make Redis 3.0 (check here http://redis.io/download) | |
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
I need to install pg 0.17.1 gem on a server running CentOS. This is the error message I saw: | |
# gem install pg -v '0.17.1' | |
Building native extensions. This could take a while... | |
ERROR: Error installing pg: | |
ERROR: Failed to build gem native extension. | |
/usr/bin/ruby extconf.rb | |
checking for pg_config... no | |
No pg_config... trying anyway. If building fails, please try again with |
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
Step 1: Creating the private server key. | |
sudo openssl genrsa -des3 -out server.key 2048 | |
Step 2: Creating a certificate signing request: | |
sudo openssl req -new -key server.key -out server.csr | |
This command will prompt terminal to display a lists of fields that need to be filled in. |
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
For nginx: | |
location ~* \.(ttf|ttc|otf|eot|woff|svg|font.css)$ { | |
add_header Access-Control-Allow-Origin *; | |
expires 1M; | |
access_log off; | |
add_header Cache-Control "public"; | |
} |
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
$ mina deploy | |
-----> ERROR: another deployment is ongoing. | |
Delete the lock file to continue. | |
$ mina deploy:force_unlock | |
-----> Unlocking | |
$ rm /var/www/kickstack.me/deploy.lock | |
$ mina deploy | |
# ...The deploy should proceed now |
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
I had some error while I used ng-click | |
<a ng-click="#/search/San+Francisco">test</a> | |
instead of ng-href | |
<a ng-href="#/search/San+Francisco">test</a> | |
I hope it might help |
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
# QUESTION 1 | |
# What’s the problem with the following controller code? What would be the consequence of leaving this code in a production app? How would you fix it? | |
class MyController < ApplicationController | |
def options | |
options = {} | |
available_option_keys = [:first_option, :second_option, :third_option] | |
all_keys = params.keys.map(&:to_sym) | |
set_option_keys = all_keys & available_option_keys | |
set_option_keys.each do |key| | |
options[key] = params[key] |
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
## Place in config/initializers/00_pending_migrations.rb | |
# Raise an error and abort the run there are any pending migrations: | |
if Rails.env.development? | |
# Rails 4 way ;) | |
if Rails.version >= '4' | |
ActiveRecord::Migration.check_pending! | |
else | |
# Rails 3 way - TODO: remove when we up to Rails 4 | |
migrator = ActiveRecord::Migrator.new( |
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
class GooglePlayVerification | |
require 'google/api_client' | |
# Refer: | |
# https://code.google.com/p/google-api-ruby-client/issues/detail?id=72 | |
# and | |
# http://jonathanotto.com/blog/google_oauth2_api_quick_tutorial.html | |
# and | |
# http://milancermak.wordpress.com/2012/08/24/server-side-verification-of-google-play-subsc/ | |
GOOGLE_KEY = 'xxx-xxx.apps.googleusercontent.com' |
OlderNewer