This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Create display override file to force Mac OS X to use RGB mode for Display | |
# see http://embdev.net/topic/284710 | |
require 'base64' | |
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# By Uğur Özyılmazel, @vigobronx | @ugurozyilmazel | |
# http://vigodome.com | http://ugur.ozyilmazel.com | http://github.com/vigo | |
def get_paged_memory_usage(match_string, paging=4096) | |
mvar = 3 | |
if match_string.split(/[^\w]/).length > 1 | |
mvar = 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reduces a color's brightness by a percentage | |
# returns a hex value in the format "#x0x0x0" | |
def self.darken(hex,percent) | |
# convert to r,g,b | |
rgb_version = hex.to_s.gsub("#","").scan(/../).map {|color| color.to_i(16)} | |
# reduce values by 'percent' | |
new_rgb_color = rgb_version.map {|rgb| (rgb - (rgb * percent.to_f/100)).ceil} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script will take a list of user names | |
# formatted like so: Amos, Deborah K | |
# and convert the name into LastnameFirstInitial | |
# to use for searching Active Directory for | |
# matching computer names... | |
require 'net-ldap' | |
@ldap = Net::LDAP.new :host => "ip-addr-of-dc", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<fieldset><span class="default">Customizable? | |
<input type="radio" name="customizable" id="cust_y" value="Yes" action="open#custom" /> | |
<label for="cust_y" class="default">Yes</label> | |
<input type="radio" name="customizable" id="cust_n" value="No" action="open#normal" /> | |
<label for="cust_n" class="default">No</label></span> | |
</fieldset> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = array( | |
'User' => 'user', | |
'Password' => 'pass', | |
'PhoneNumbers' => array('1234567890'), | |
'Subject' => 'subject', | |
'Message' => 'message' | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a guide for how I installed rails 3.2.2 on Mac OS X 10.7.3 Lion upgrade. | |
# There is no Warranty expressed, and I am not responsible for any issues that may arise from following this guide. | |
# - inspired by tuscanidream | |
# Install RVM | |
$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer) | |
# Add the following line to your .bash_profile to load RVM into your new shells | |
[[ -s "/Users/my_user_name/.rvm/scripts/rvm" ]] && source "/Users/my_user_name/.rvm/scripts/rvm" # This loads RVM into a shell session. |
NewerOlder