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
One may accidentally set up security realm / authorization in such a way that you may no longer able to reconfigure Jenkins. | |
When this happens, you can fix this by the following steps: | |
Stop Jenkins (the easiest way to do this is to kill the servlet container.) | |
Go to $JENKINS_HOME in the file system and find config.xml file. | |
Open this file in the editor. | |
Look for the <useSecurity>true</useSecurity> element in this file. | |
Replace true with false | |
Remove the elements authorizationStrategy and securityRealm |
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
To save time from repeatedly typing the same dataset with little difference, it is better to use erb script to help the process. By using the erb script, you can generate a lot of data using just a few lines of code. | |
Here is common troubleshooting: | |
a. The file extension will still be .yml, not .erb . | |
b. When you write your script, prevent the use of <tab>. | |
Enjoy and get back to work. |
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
RailsGuide::Application.routes.draw do | |
resources :posts | |
# The priority is based upon order of creation: first created -> highest priority. | |
# See how all your routes lay out with "rake routes". | |
# You can have the root of your site routed with "root" | |
# root 'welcome#index' | |
root to: 'posts#index' |
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
'use strict'; | |
/* Controllers */ | |
angular.module('myApp.controllers', []) | |
.controller('MyCtrl1', [function($scope, $http) { | |
$http.get('localhost:3000/posts/1.json').success(function(data){ | |
$scope.posts = 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
JAVASCRIPT | |
I would like to let you know that most people go through a Javascript test which will have to be very well commented on (with proper indentations and follow strictly the descriptions as following). You will have 7 days to take the test and pass it back to us. | |
Basic Requirement: | |
- Build a chart with custom icons | |
- Build an editor to accommodate the chart |
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
if you get error message: | |
undefined method `equipment_index_path' | |
you are probably violated the pluralize convention when naming the model. | |
For next time, please launch rails c, then use '[Enter word here]'.pluralize to make sure the word fits the convention. |
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
After wondering why I can't pass my model validation after assigning false boolean, | |
I run some test in console. | |
I found out that the value false is equivalent to blank. So if you set your model to validate presence, you will get error when you pass false into your input field. |
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
After configure Nginx and Passenger correctly, you should check on config/environments/production.rb to make sure that force-ssl is false. If you tend to use SSl for your application, you will be using port 443 and required to buy SSL certificate from vendors. |
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
Taken from: http://alexbachuk.com/launch-rails-4-application-with-passenger-and-nginx/ | |
ssh [email protected] SSH as root, using IP address and password you get by email | |
adduser alex Create new username, because using root is not recommended. | |
visudo Open sudo config file and add admin privileges to newly created user. | |
alex ALL=(ALL) ALL) add this and ctrl+x to save ‘y’ and enter to overwrite | |
sudo apt-get update update system packages | |
curl -L get.rvm.io | bash -s stable install ruby version manager | |
source ~/.rvm/scripts/rvm load RVM | |
rvm requirements install all RVM dependencies |
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
boot live cd | |
sudo add-apt-repository ppa:yannubuntu/boot-repair | |
sudo apt-get update | |
sudo apt-get install -y boot-repair | |
boot-repair |