Skip to content

Instantly share code, notes, and snippets.


Orlin M Bozhinov orlin

  • Astrolet
  • Varna, Bulgaria
  • Twitter @orlin
View GitHub Profile
JosephPecoraro / shell-execution.rb
Last active Apr 11, 2022
Shell Execution in Ruby
View shell-execution.rb
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Synchronous (blocking)
# Returns the output of the shell command
# Docs:
View gist:58761
var DateHelper = {
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time
// Ruby strftime: %b %d, %Y %H:%M:%S GMT
time_ago_in_words_with_parsing: function(from) {
var date = new Date;
return this.time_ago_in_words(date);
time_ago_in_words: function(from) {
View gist:160263
echo "Setting up chef..."
sudo apt-get -y update
sudo apt-get -y install ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert
cd /tmp
tar zxf rubygems-1.3.4.tgz
View deploy.rake
task :deploy => ['deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
task :migrations => [:push, :off, :migrate, :restart, :on, :tag]
task :rollback => [:off, :push_previous, :restart, :on]
task :push do
puts 'Deploying site to Heroku ...'
puts `git push heroku`
View debug.js
require.registerExtension('.js', function(js){
return js.replace(/^ *\/\/debug: */gm, '');
seancribbs /
Created Jan 7, 2011
WIP port of Ripple's Riak::TestServer to riak-js
$ node ts.js
10 Jan 15:01:23 - prepared
10 Jan 15:01:24 - started
PUT /riak/airlines/KLM
10 Jan 15:01:24 - saved
10 Jan 15:01:24 - cleared
GET /riak/airlines/KLM
10 Jan 15:01:24 - not found! it works
mbbx6spp / Vagrantfile.rb
Created Feb 5, 2011
Riak cluster Vagrantfile to offer an alternative to Basho Chef+Vagrant blog post suggestion and receive feedback at
View Vagrantfile.rb
# Offering alternative Chef + Vagrant Riak cluster setup to the following blog post at basho:
# Assumes Vagrant 0.7.0+ and VirtualBox 4.0+
# Now you should be able to launch your X (where X=4 in this case) vagrant VMs with the following:
# % vagrant up db1
# % vagrant up db2
# % vagrant up db3
# % vagrant up db4
jbz / knife.rb
Created Feb 16, 2011
knife.rb that switches Opscode orgs/validators based on git branch
View knife.rb
# This knife.rb orig. provided by - but any mistakes are mine!
current_dir = File.dirname(__FILE__)
platform = ""
require 'grit'
branch ="#{current_dir}/..")
case branch
View require-json.js
require.extensions[".json"] = function (module, filename) {
module.exports = JSON.parse(require("fs").readFileSync(filename, "utf8"))
jrburke / apiexamples.js
Created Apr 7, 2011
Description of browser-friendly module APIs: AMD and Loader Plugins
View apiexamples.js
// Level 1, basic API, minimum support
Modules IDs are strings that follow CommonJS
module names.
//To load code at the top level JS file,
//or inside a module to dynamically fetch