Skip to content

Instantly share code, notes, and snippets.

View elmariofredo's full-sized avatar
💭
building Cloud Native Thermostat 🔥 🥶

Mario Vejlupek elmariofredo

💭
building Cloud Native Thermostat 🔥 🥶
View GitHub Profile
@elmariofredo
elmariofredo / Ubuntu Rails Hosting bootstrap.sh
Created June 6, 2010 18:01
Ubuntu Ruby1.9.1/Rails3 Hosting bootstrap
aptitude install ruby1.9.1 rubygems1.9.1 libruby1.9.1 nginx mysql-server libmysql-ruby1.9.1 build-essential ruby1.9.1-dev libopenssl-ruby1.9.1 libssl-dev zlib1g-dev
gem install rubygems-update
ln /usr/bin/ruby1.9.1 /usr/bin/ruby
/var/lib/gems/1.9.1/gems/rubygems-update-1.3.7/bin/update_rubygems
gem install rails --pre --no-rdoc --no-ri
gem install passenger --no-rdoc --no-ri
passenger-install-nginx-module
# Everything you need to do to get started with Rails 2.3.8
#
# As of June 14th, 2010 @ 2:30 p.m. MST
#
# This gist now features instructions to get Rails 3 up and running with:
# - Ruby 1.8.7-p174
# - Bundler 0.9.26
# - Cucumber 0.8.0
# - Rspec 1.3.0 + Rspec-Rails 1.3.2
# - RVM
Growl::Notifier.sharedInstance.notify('new_messages', 'title', 'desc', :click_context => 'titel-context')
# based on https://rails.lighthouseapp.com/projects/8994/tickets/4807-error-encodingundefinedconversionerror-xc3-from-ascii-8bit-to-utf-8
# invalid multibyte char (UTF-8), ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
diff --git a/activesupport/lib/active_support/buffered_logger.rb b/activesupport/lib/active_support/buffered_logger.rb
index 29c3843..5e562ee 100644
--- a/activesupport/lib/active_support/buffered_logger.rb
+++ b/activesupport/lib/active_support/buffered_logger.rb
@@ -100,7 +100,12 @@ module ActiveSupport
def flush
@guard.synchronize do
unless buffer.empty?
##################################################################################
# Deploy
# Awesome deploy script stolen from:
# http://glu.ttono.us/articles/2008/04/05/really-simple-git-deployment-with-vlad
##################################################################################
begin
require 'rake_remote_task'
APP_NAME = "someapp"
set :application, "website"
set :scm, :git
set :ssh_options, { :forward_agent => true }
set :repository, "git@github.com:user/#{application}.git"
set :repository_cache, "git-cache"
set :deploy_via, :remote_cache
role :web, "dev.server.com"
role :app, "dev.server.com"
role :db, "dev.server.com", :primary => true
@elmariofredo
elmariofredo / US_phone_formatter.js
Created March 30, 2011 17:51
Simply format number to US phone format using JavaScript, look at example on http://jsbin.com/etede5/5
var number = "1234567890";
var formatted_number = "";
var number_of_digits = number.length-1;
var bracket = false;
for(var i=number_of_digits; i>=0; i--) {
var digit = number[i];
var position = number_of_digits-i;
switch(position) {
<configuration>
<property>
<name>com.trex.mapreduce.job_root</name>
<value>http://localhost:3000</value>
</property>
<property>
<name>com.trex.mapreduce.database_address</name>
<value>jdbc:mysql://localhost/trex_production</value>
@elmariofredo
elmariofredo / vagrant.org
Created October 17, 2012 15:06
CentOS Box for Vagrant
@elmariofredo
elmariofredo / 01_clean_yesterday_index
Created November 2, 2012 09:52
Daily Indexer Cleaner
#!/bin/sh
# Remove Index older than 8 hours
find /var/tmp/ -name "j-*" -mmin +500 -exec rm -r {} \;