Skip to content

Instantly share code, notes, and snippets.

View toobulkeh's full-sized avatar
🎯
Focusing

Dan Moore toobulkeh

🎯
Focusing
View GitHub Profile
@toobulkeh
toobulkeh / gist:4048262
Created November 9, 2012 21:10
HOWTO: Install a Rails Development Environment on Debian on Virtualbox inside Windows 7 & 8
#Instruction Sources:
# Guest Additions on Debian - http://virtualboxes.org/doc/installing-guest-additions-on-debian/
sudo su -
apt-get update
apt-get upgrade
apt-get install build-essential module-assistant
m-a prepare #Click on Install Guest Additions… from the Devices menu, then run
mount /media/cdrom.
sh /media/cdrom/VBoxLinuxAdditions.run #and follow the instructions on screen.
# Install XFCE4 - http://wiki.debian.org/Xfce
@toobulkeh
toobulkeh / YUIchart.php
Created November 19, 2012 21:53
YUI Chart Test
<?php
$chartData = array(array("category"=>"5/1/2010","miscellaneous"=>2000,"expenses"=>3700),
array("category"=>"5/2/2010","miscellaneous"=>50,"expenses"=>9100),
array("category"=>"5/3/2010","miscellaneous"=>400,"expenses"=>1100),
array("category"=>"5/4/2010","miscellaneous"=>200,"expenses"=>1900),
array("category"=>"5/5/2010","miscellaneous"=>5000,"expenses"=>5000));
?>
<script>
// Create a new YUI instance and populate it with the required modules.
@toobulkeh
toobulkeh / gist:4199409
Created December 4, 2012 00:35
Facebook SRR
This agreement was written in English (US). To the extent any translated version of this agreement conflicts with the English version, the English version controls. Please note that Section 17 contains certain changes to the general terms for users outside the United States.
Date of Last Revision: November XX/December XX, 2012.
Statement of Rights and Responsibilities
This Statement of Rights and Responsibilities ("Statement," "Terms," or "SRR") derives from the Facebook Principles, and is our terms of service that governs our relationship with users and others who interact with Facebook. By using or accessing Facebook, you agree to this Statement, as updated from time to time in accordance with Section 14 below. Additionally, you will find resources at the end of this document that help you understand how Facebook works.
Privacy
Your privacy is very important to us. We designed our Data Use Policy to make important disclosures about how you can use Facebook to share with others and how we collect and can
@toobulkeh
toobulkeh / development.pp
Last active December 10, 2015 14:08
Puppet Dependency Syntax
#Define Extra Stages of Install
#Note: "rvm-install" stage is defined in the "rvm" module
stage { 'req-install': before => Stage['rvm-install'] }
stage { 'rvm-install': before => Stage['ruby-install'] }
stage { 'ruby-install': before => Stage['rails-install'] }
stage { 'rails-install': before => Stage['main'] }
class install_reqs {
group { "puppet": ensure => "present", }
exec { "apt-update":
@toobulkeh
toobulkeh / performance_data.rb
Last active January 3, 2024 09:08
rbvmomi performance manager usage
vim = RbVmomi::VIM.connect host: vcenter.hostname, user: vcenter.username, password: vcenter.password, insecure: true
pm = vim.serviceInstance.content.perfManager
# this is for a single cluster with hosts directly in one cluster. 'first' returns the cluster object.
hosts = vim.serviceInstance.find_datacenter.hostFolder.children.first.host
pm.retrieve_stats([hosts[0]], ['cpu.usagemhz'], {interval: '300', start_time: (Time.now - 6.hours)}).first[1][:metrics]['cpu.usagemhz']
# This above query queries for the 'cpu.usagemhz' counter, which by default matches the (none) rollup counter (NOT THE AVERAGE) in vSphere API.
# This is a problem with the RbVmomi gem helper function "retrieve_stats" only. To override this, use the following manual counter selection:
@toobulkeh
toobulkeh / devtools.md
Last active December 31, 2015 18:59
OSX Dev & Misc Tools
@toobulkeh
toobulkeh / deploy.rb
Created January 2, 2014 02:42 — forked from benedikt/rails.rb
Updated for Capistrano 3.
# encoding: UTF-8
# Place in config/deploy.rb
namespace :rails do
desc "Open the rails console on each of the remote servers"
task :console do
on roles(:app) do |host| #does it for each host, bad.
rails_env = fetch(:stage)
execute_interactively "ruby #{current_path}/script/rails console #{rails_env}"
@toobulkeh
toobulkeh / processdiagram.js
Created March 2, 2014 01:01
BlackPixel's ProcessDiagram Gist
processDiagram: function () {
if (e("#process-diagram").length > 0) {
e("a.num-block").click(function () {
e("ul.diagram.process").toggleClass("active");
e(this).parent().hasClass("out") ? e(this).parent().removeClass("out") : e(this).parent().hasClass("active") && setTimeout(function () {
e(this).parent().addClass("out")
}, 2e3)
});
e("#process-diagram").easytabs({
animate: !1,
@toobulkeh
toobulkeh / nvlabs.html
Created March 2, 2014 01:06
EnvyLabs Hero Slider
<div class="hero">
<img alt="Illustration Base" height="500" src="images/hero/base.png" width="1040">
<img alt="We Pursue Excellence" class="hero-slide active" height="500" src="images/hero/excellence.png" width="1040">
<img alt="We Practice Transparency" class="hero-slide" height="500" src="images/hero/transparency.png" width="1040">
<img alt="We Foster Education" class="hero-slide" height="500" src="images/hero/education.png" width="1040">
<img alt="We Create Fun" class="hero-slide prev" height="500" src="images/hero/fun.png" width="1040">
<a class="hero-prev" href="#">Prev</a>
<a class="hero-next" href="#">Next</a>
</div>
require 'nokogiri'
require 'open-uri'
MARK_FILE = "mark.dat"
MAX_THREADS = 5
def wait_for_threads(threads)
print "Waiting for downloads to finish..."
threads.each { |t| t.join }
puts " ok"