Ruby
ruby -run -ehttpd . -p8000
Node
npm install -g http-server
http-server -p 8000
Ruby
ruby -run -ehttpd . -p8000
Node
npm install -g http-server
http-server -p 8000
// Chrome | |
rm -rf ~/Library/Application\ Support/Google | |
rm -rf ~/Library/Caches/com.google.* | |
rm -rf ~/Library/Google | |
// Lastpass | |
rm -rf ~/Library/Application\ Support/com.lastpass.lastpassmacdesktop | |
rm -rf ~/Library/Caches/com.lastpass.lastpassmacdesktop | |
rm -rf ~/Library/Preferences/com.lastpass.lastpassmacdesktop.plist | |
rm -rf ~/Library/Containers/com.lastpass.LastPass |
### Internet | |
# Optional argument name=nil | |
Faker::Internet.safe_email #=> "[email protected]" | |
# Optional arguments specifier=nil, separators=%w(. _) | |
Faker::Internet.username #=> "alexie" | |
# Optional arguments: min_length=8, max_length=16 | |
Faker::Internet.password #=> "Vg5mSvY1UeRg7" | |
Faker::Internet.ip_v4_address #=> "24.29.18.175" |
require 'benchmark' | |
class Fibonacci | |
def self.calculate(n) | |
return n if n <= 1 | |
calculate(n - 1) + calculate(n - 2) | |
end | |
def self.calculate_with_memoization(n) | |
@calculate ||= {} |
mongo
db.serverStatus().mem
db.serverStatus().tcmalloc.tcmalloc.formattedString
db.serverStatus().storageEngine
db.serverStatus().wiredTiger
# model
# enumerizeがlocaleされている。
extend Enumerize
enumerize :account_type, in: { normal: 0, easy: 1, hard: 2, test: 3 },scope: true
# controller
@types = User.account_type.options
@types.map.with_index { |type, index| type[1] = index }
User.first.send_confirmation_instructions
$.ajax({
type : "POST",
url : 'http://localhost:3001/plugin/bulk_import/',
dataType: 'json',
contentType: 'application/json',
data : JSON.stringify({"shared_items": [{"entity_id":"253","position":1}, {"entity_id":"823","position":2}]})
});
ActionController::UnknownFormat is missing a template for this request format and variant
Add format: :js
put :update, params: { cart: { duration: 30 } }, format: :js
Just another way of doing it ;-)
npm i -g pm2
pm2 start npm --name "your-app-alias" -- start