Skip to content

Instantly share code, notes, and snippets.

# THIS CODE IS VERY UGLY
# I AM NOT SORRY
# Copyright 2013 Kyle Varga
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
MBProgressHUD.showHUDAddedTo(@view, animated:true)
BW::Reactor.defer(proc do
@posts = Post.query.find
end, proc do
MBProgressHUD.hideHUDForView(@view, animated:true)
end)
@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 / 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 / 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 / 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 / ragios.rb
Created February 24, 2012 19:52 — forked from kivanio/ragios.rb
St. Ruby - A Ruby based Object Oriented System and Network Monitoring Tool
#!/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'
@noeticpenguin
noeticpenguin / Datastore.rb
Created January 30, 2012 22:10 — forked from cpowell/Datastore.rb
A singleton class to manage a MacRuby application's data storage requirements.
#
# Datastore.rb
# A singleton class to manage a MacRuby application's data storage requirements.
#
# Chris Powell, cpowell@prylis.com, 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/
@noeticpenguin
noeticpenguin / PaddedTextFieldCell.rb
Created January 1, 2012 23:07 — forked from micahbrich/PaddedTextFieldCell.rb
Awesome Text Fields in MacRuby
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