This file contains 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
String[] stringArray = {"a", "b", "c"}; // Compile okay | |
String[] stringArray2 = {'a', 'b', 'c'}; // single quotation is for Character Class | |
Character[] charArray = {'a', 'b', 'c', 'd'}; // Compile okay | |
Character[] charArray2 = {"a", "b"}; // Error: Double quotation is parsed as String | |
Character[] charArray3 = {'ab'}; // Error: Too many characters. Can only have one. |
This file contains 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
// Created in CarsFragment.java | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, | |
Bundle savedInstanceState) { | |
// Inflate the layout for this fragment | |
View rootView = inflater.inflate(R.layout.fragment_cars, container, false); | |
String[] dummyCarData = { |
This file contains 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
# where 6 = showing the sixth commit. | |
git rev-list --all | tail -n 6 | head -n 1 | |
# $> b753a30804cc0770b52686166a21cbdea642ff08 | |
# Knowing the output, we can then do the following to checkout to that certain commit | |
git checkout b753 |
This file contains 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
// http://javarevisited.blogspot.hk/2011/12/final-variable-method-class-java.html | |
// Final variable | |
final int CONSTANT_PI = 3.14; // Note constant are usually defined in ALL CAPS | |
CONSTANT_PI = 2.14; // will cause compilation error | |
// final method | |
// final method cannot be overriden by subclass | |
// final Class |
This file contains 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
ActiveRecord::Base.logger = Logger.new(STDOUT) |
This file contains 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
# Check netstat | |
netstat -anp tcp | |
# List which apps are using port 5000 | |
lsof -i :5000 | |
# Check brew package info | |
brew info elasticsearch | |
# To start elasticsearch without launctl |
This file contains 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
# It checks the cron jobs that run before | |
sudo grep CRON /var/log/syslog | |
# Check timezone | |
cat /etc/timezone | |
# Restart Crontab | |
sudo /etc/init.d/cron restart | |
This file contains 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
devise_for :users, | |
:skip => [:registrations, :sessions] | |
as :user do | |
# Sessions | |
get '/login2' => 'users/sessions#new', :as => :new_user_session | |
# :new_user_session is being defined by devise_for :users already, so have to use :skip! | |
end | |
This file contains 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
as :user do | |
# Sessions | |
get '/login' => 'users/sessions#new', as: :new_user_session | |
# Registration | |
controller 'users/registrations' do | |
get '/signup', action: :new, as: :new_user_registration | |
end | |
end |
This file contains 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
Sprockets::FileNotFound: couldn't find file 'swiper/dist/js/swiper.jquery.js' with type 'application/javascript' | |
How to solve? |
OlderNewer