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
# In response to: | |
# http://mlomnicki.com/ruby/tricks-and-quirks/2011/02/10/ruby-tricks2.html | |
# Ruby 1.9.2 has some neat stuff that lets us make a readable | |
# alternative case statement that calls each method in turn. | |
# 1.9.2 features used: | |
# * hashes are ordered in 1.9.2 | |
# * cool JSON-style hash syntax | |
# * concise lambda syntax |
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
curl https://raw.github.com/gist/1008945/4edd1e1dcc1f0db52d4816843a9d1e6b60661122/ruby-1.9.2p290.patch > /tmp/ruby-1.9.2p290.patch | |
rvm install ruby-1.9.2-p290 --patch /tmp/ruby-1.9.2p290.patch |
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
# Prompt Setup | |
YELLOW='\[\033[1;33m\]' | |
BLUE='\[\033[1;34m\]' | |
GREEN='\[\033[1;32m\]' | |
RED='\[\033[0;31m\]' | |
NORMAL='\[\033[00m\]' | |
WHITE='\[\033[0;37m\]' | |
function minutes_since_last_commit { |
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
# | |
# Initialize the stuff | |
# | |
# We build the status bar item menu | |
def setupMenu | |
menu = NSMenu.new | |
menu.initWithTitle 'FooApp' | |
mi = NSMenuItem.new | |
mi.title = 'Hellow from MacRuby!' | |
mi.action = 'sayHello:' |
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
class PaddedTextFieldCell < NSTextFieldCell | |
def drawingRectForBounds(cellFrame) | |
super | |
result = cellFrame | |
padding_left = (result.size.width / 16).round # to make sure text is clear | |
padding_top = (result.size.height / 4).round | |
result.origin.x += padding_left | |
result.origin.y += padding_top |
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
# | |
# Datastore.rb | |
# A singleton class to manage a MacRuby application's data storage requirements. | |
# | |
# Chris Powell, [email protected], http://cbpowell.wordpress.com | |
# | |
# This work is licensed under a Creative Commons Attribution 3.0 Unported License. | |
# http://creativecommons.org/licenses/by/3.0/ | |
# | |
# For usage and discussion, see http://cbpowell.wordpress.com/category/macruby/ |
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 | |
#Title :Ragios (aka St. Ruby) | |
#Date :10/13/2010 | |
#Author :Obi Akubue | |
#Version :0.3.3 | |
#description: This is the framework for a Ruby Based System and Network Monitoring Tool | |
#this project is just an excuse to play with ruby and linux servers | |
require 'net/http' |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
<apex:page controller="CustomSettingController"> | |
<apex:pageMessages id="msgs" /> | |
<apex:form id="theform"> | |
<apex:inputField value="{!cs.Field1__c}" /> | |
<apex:inputField value="{!cs.Field2__c}" /> | |
<apex:commandButton value="{!$Label.CSTab_Save}" action="{!update}" rerender="msgs,theform" /> | |
</apex:form> | |
</apex:page> |
OlderNewer