Skip to content

Instantly share code, notes, and snippets.

View filiptepper's full-sized avatar
🏠
Working from home

Filip Tepper filiptepper

🏠
Working from home
View GitHub Profile
#!/bin/sh
#This is a start script for nginx. Tested on Unbuntu Edge.
#Should work on Ubuntu, Debian and probably a few other Linux distros.
#Change DAEMON and CONFIG_FILE if neccessary
PATH=/sbin:/bin:/usr/sbin:/usr/bin
#Location of nginx binary. Change path as neccessary
rvm remove 1.9.2
curl https://gist.github.com/raw/999435/fc2718ac3f488ab2341b65dc2ae5c123f8859bff/fast-require-ruby-19.2-p180 > /tmp/require-performance-fix.patch
rvm install 1.9.2 --patch /tmp/require-performance-fix.patch
server "a.production.com", :app
server "b.production.com", :app
Ext.require(['Ext.grid.*', 'Ext.data.*', 'Ext.util.*', 'Ext.state.*', 'Ext.window.*']);
Ext.onReady(function() {
var myData = [
['3m Co']];
var store = Ext.create('Ext.data.ArrayStore', {
fields: [
{
name: 'company'
@filiptepper
filiptepper / profile #1
Created April 29, 2011 07:15
Bug in JRuby's profiler?
main thread profile results:
Total time: 21.13
total self children calls method
----------------------------------------------------------------
18.16 0.00 18.16 1 RSpec::Core::Runner.run
18.01 0.01 18.00 189 Array#collect
17.95 0.00 17.95 1 RSpec::Core::Runner.run_in_process
17.95 0.00 17.95 1 RSpec::Core::CommandLine#run
16.90 0.00 16.90 1 RSpec::Core::Reporter#report
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
var array = [];
var emptyArray = [];
console.log(array);
// Google Chrome 10.0.648.204 #=> [1, 2, 3, 4, 5, 6] - WTF?
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
var array = [];
var emptyArray = [];
console.log(array);
// Google Chrome 10.0.648.204 #=> [1, 2, 3, 4, 5, 6] - WTF?
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script type="text/javascript">
alert("string".constructor == String);
</script>
</body>
</html>
@filiptepper
filiptepper / rackup-kirk
Created March 8, 2011 11:02
start/stop/restart JRuby application running on Kirk
#! /bin/sh
set -u
NAME=<set your application name here>
DIRECTORY=<set your application directory here>
PIDFILE=/var/run/$NAME.pid
DAEMON="/usr/local/rvm/bin/rvm exec rackup"
DAEMON_ARGS="-s Kirk config.ru -p 3000 -P $PIDFILE"
class ModelBase < ActiveRecord::Base
end
class BaseA < ModelBase
has_many :things, :as => :model_a
end
class BaseB < ModelBase
has_many :things, :as => :model_b
end