Skip to content

Instantly share code, notes, and snippets.

@noeticpenguin
noeticpenguin / hack.sh
Created March 31, 2012 20:42 — forked from erikh/hack.sh
OSX For Hackers
#!/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
#
@noeticpenguin
noeticpenguin / hack.sh
Created April 30, 2012 12:06 — forked from erikh/hack.sh
OSX For Hackers
#!/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
#
@noeticpenguin
noeticpenguin / VF Page
Created August 2, 2012 19:02 — forked from dancinllama/VF Page
Apex Controller Class
<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>
@noeticpenguin
noeticpenguin / VF Page
Created August 2, 2012 19:02 — forked from dancinllama/VF Page
Apex Controller Class
<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>
@noeticpenguin
noeticpenguin / deploy.rb
Created August 11, 2012 11:47 — forked from andruby/deploy.rb
Start and Stop tasks for resque workers, with capistrano deploy hook (without God)
after "deploy:symlink", "deploy:restart_workers"
##
# Rake helper task.
# http://pastie.org/255489
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/
def run_remote_rake(rake_cmd)
rake_args = ENV['RAKE_ARGS'].to_s.split(',')
cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}"
@noeticpenguin
noeticpenguin / exmapleDobedobedoUsage.rb
Created October 25, 2012 13:42
Dobedobedo gem Usage
require 'dobedobedo' # please do this with the bundler.
include Dobedobedo # gives you access to the top level models.
#Dobedobedo does not use the web-flow for oAuth integration, instead relying on username and password, in conjunction with the oAuth client id / secret
connection = Dobedobedo::Connection.new(:client_id => 'Your Client Id',
:client_secret => 'Your Client Secret',
:username => 'Your Email Address',
:password => 'Your Passsord Here')
#by_name is an alias to find_workspace_by_name
workspace = connection.by_name('workspace name here')
@noeticpenguin
noeticpenguin / dobedobedo.md
Created November 27, 2012 14:52
Dobedobedo gem Usage

Installation

Add this line to your application's Gemfile:

gem 'dobedobedo'

And then execute:

$ bundle
@noeticpenguin
noeticpenguin / meetupapp.html
Created April 29, 2013 15:18
MeetupApp.html
<apex:page docType="html-5.0"
showHeader="false" sidebar="false"
standardController="Contact">
<apex:stylesheet value="{!URLFOR($Resource.MobileSample_Resources_jQueryMobile, 'jquery.mobile-1.3.0.min.css')}"/>
<apex:includeScript value="{!URLFOR($Resource.MobileSample_Resources_jQueryMobile, 'jquery-1.9.1.min.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.MobileSample_Resources_jQueryMobile, 'jquery.mobile-1.3.0.min.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.MobileSample_Resources_jQueryMobile, 'ForceTk.js')}"/>
<head>
<title>Meetups</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
@noeticpenguin
noeticpenguin / gist:5665729
Created May 28, 2013 20:13
apex test pattern for expecting a test.
boolean codeDidThrowException = false;
string message;
try {
code_that_will_cause_an_exception
} catch (System.calloutException sce) {
codeDidThrowException = true;
message = sce.getMessage();
}
MBProgressHUD.showHUDAddedTo(@view, animated:true)
BW::Reactor.defer(proc do
@posts = Post.query.find
end, proc do
MBProgressHUD.hideHUDForView(@view, animated:true)
end)