Skip to content

Instantly share code, notes, and snippets.

mBSpecs = {};
mBSpecs.panel = CreateFrame( "Frame", "mBindingSpecs", UIParent );
-- Register in the Interface Addon Options GUI
-- Set the name for the Category for the Options Panel
mBSpecs.panel.name = "mBindingSpecs";
--mBSPecs.parent = "mBindings";
-- Add the panel to the Interface Options
InterfaceOptions_AddCategory(mBSpecs.panel);
@roloenusa
roloenusa / gist:471723
Created July 11, 2010 18:09
Objective-C
//Load from the dictionary of colors.
NSString *key;
for (key in colors) {
//Do something with the key
NSArray * a = [colors valueForKey:key];
}
@roloenusa
roloenusa / rails.rb
Created March 8, 2011 02:39
Setting up Rails as a SSL server
=begin
This is courtesy of:
http://www.nearinfinity.com/blogs/chris_rohr/configuring_webrick_to_use_ssl.html
This is ONLY for rails3 and does not work with earlier versions.
=end
# All you have to do to get WEBrick running in SSL is modify the script/rails file and add the following lines (above the APP_PATH variable declaration):
# Please modify the :SSLPrivateKey and :SSLCertificate to point at the right location.
@roloenusa
roloenusa / Ruby: Uniqueness Key
Created July 25, 2011 04:47
Ruby: Add a uniqueness key to a db.
# rails generate migration add_email_uniqueness_index
class AddEmailUniquenessIndex < ActiveRecord::Migration
def self.up
# add_index to :users. to :email, add a unique constriction.
add_index :users, :email, :unique => true
end
def self.down
remove_index :users, :email
@roloenusa
roloenusa / Ruby
Created July 25, 2011 05:18
Ruby: Adding a column to a existing table.
# -- Look at the name "add password to the table Users" with a encrypted_password column
# rails generate migration add_password_to_users encrypted_password:string
class AddPasswordToUsers < ActiveRecord::Migration
def self.up
add_column :users, :encrypted_password, :string
end
def self.down
@roloenusa
roloenusa / Ruby: Rspec
Created July 27, 2011 17:54
Ruby: Generating rspec
rails generate rspec:install
@roloenusa
roloenusa / Round borders
Created July 31, 2011 01:09
CSS Round border
.round {
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
}
require 'cgi'
require 'uri'
require 'net/http'
require 'open-uri'
require 'nokogiri'
puts "Please copy/paste the MLS link provided by your realtor:"
url = gets().chomp
uri = URI(url)
@roloenusa
roloenusa / git_aliases.sh
Last active February 23, 2018 21:58
Git Aliases
git config --global alias.lol "log --graph --pretty=format:'%C(bold blue)%h%Creset %C(bold green)<%an>%Creset%Cgreen (%cr)%Creset%C(yellow)%d%Creset %s' --abbrev-commit --date=relative"
git config --global alias.lolme "log --graph --pretty=format:'%C(bold blue)%h%Creset %C(bold green)<%an>%Creset%Cgreen (%cr)%Creset%C(yellow)%d%Creset %s' --abbrev-commit --date=relative --author=$(git config user.email)"
git config --global alias.me "whatchanged --graph --pretty=format:'%C(bold blue)%h%Creset %C(bold green)<%an>%Creset%Cgreen (%cr)%Creset%C(yellow)%d%Creset %s' --abbrev-commit --date=relative --author=$(git config user.email)"
@roloenusa
roloenusa / settings.json
Created January 3, 2019 18:08
Sublime Text Settings
{
"caret_extra_width": 1,
"color_scheme": "Packages/Twilight+/Twilight+.tmTheme",
"file_exclude_patterns":
[
"*.log"
],
"folder_exclude_patterns":
[
".svn",