Server: Nginx with Phusion Passenger
Ruby Version: 2.1.3
User System: deploy
Array.prototype.random = function () { | |
return this[Math.floor((Math.random()*this.length))]; | |
} | |
skins = ['poland', 'usa', 'china', 'russia', 'canada', 'australia', 'spain', 'brazil', 'germany', 'ukraine', 'france', 'sweden', 'chaplin', 'north korea', 'south korea', 'japan', 'united kingdom', 'earth', 'greece', 'latvia', 'lithuania', 'estonia', 'finland', 'norway', 'cia', 'maldivas', 'austria', 'nigeria', 'reddit', 'yaranaika', 'confederate', '9gag', 'indiana', '4chan', 'italy', 'ussr', 'bulgaria', 'tumblr', '2ch.hk', 'hong kong', 'portugal', 'jamaica', 'german empire', 'mexico', 'sanik', 'switzerland', 'croatia', 'chile', 'indonesia', 'bangladesh', 'thailand', 'iran', 'iraq', 'peru', 'moon', 'botswana', 'bosnia', 'netherlands', 'european union', 'taiwan', 'pakistan', 'hungary', 'satanist', 'qing dynasty', 'matriarchy', 'patriarchy', 'feminism', 'ireland', 'texas', 'facepunch', 'prodota', 'cambodia', 'steam', 'piccolo', 'ea', 'india', 'kc', 'denmark', 'quebec', 'ayy lmao', 'sealand', 'bait', 'tsarist russia', |
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
didInsertElement: function() { | |
var self = this; | |
this.$('.modal') | |
.modal('show') | |
.on('hide.bs.modal', function() { | |
self.sendAction('onModalClose'); | |
}); |
function arraySum(arr) { | |
if(typeof arr == 'number') return arr; | |
return arr.filter(function(item) { | |
return Array.isArray(item) || Number.isFinite(item); | |
}).reduce(function(memo, item) { | |
return memo + arraySum(item); | |
}, 0); | |
} | |
var arr = [7,4,1, [3,true,2], 1, '123']; | |
alert(arraySum(arr)); |
#=========================================== | |
# 1. Benchmark | |
# | |
require 'benchmark' | |
Benchmark.bmbm do |x| | |
x.report ('<<') do | |
1_000_000.times do | |
one = 'one' | |
two = 'two' |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
require './engine_interface' | |
class Engine | |
def self.init_with_name name | |
new | |
@name = name | |
end | |
def start | |
puts "Starting" |
Reset mysql password (MAC): | |
> mysql.server stop | |
> mysql.server start --skip-grant-tables | |
> mysql | |
> update mysql.user set Password=PASSWORD('new_password') WHERE User='root' |