Skip to content

Instantly share code, notes, and snippets.

View dmauldin's full-sized avatar

Dave Mauldin dmauldin

  • Seattle, WA
View GitHub Profile
@dmauldin
dmauldin / config.lua
Created May 24, 2017 18:16
my hammerspoon config
hs.hotkey.bind({"cmd", "ctrl"}, "M", function()
local win = hs.window.focusedWindow()
local f = win:frame()
local screen = win:screen()
local max = screen:frame()
f.x = max.x
f.y = max.y
f.w = max.w
f.h = max.h
class Event < ActiveRecord::Base
include IceCube
validates :name, :presence => true
validates :recurring_schedule, :presence => true
def recurring_schedule=(schedule)
Rails.logger.debug("recurring_schedule= called #{schedule.inspect}")
self.schedule_yaml = schedule.to_yaml
end
var userRef = new Firebase("https://shining-fire-453.firebaseio.com/users");
userRef.child(authData.uid).once("value",function(snapshot) {
console.log("snapshot in userREf",snapshot);
var fullName = snapshot.val().name;
console.log("fullname",fullName);
var displayName = fullName.split(' ');
localStorage.setItem("firstName", displayName[0]);
//redirect to user-enabled home page
console.log("welcome back, welcome back, welcoooome baack...");
class User < ActiveRecord::Base
has_many :study_groups
has_many :studies, :through => :study_groups
has_many :roles, :through => :user_roles
def admin
true if self.roles.include?("admin")
end
def manager
class User < ActiveRecord::Base
has_many :study_groups
has_many :studies, :through => :study_groups
has_many :roles, :through => :user_roles
end
class Role < ActiveRecord::Base
has_many :users, :through => :user_roles
end
var configData = {
"type": "Application",
"name": "Some Crazy Stuff In My Hangout Oh Yeah!!!",
"localizationID": "Effects",
"showRandomizer": true,
"id": 3,
"localizationPath": "",
"googleAnalyticsAccount": "",
"simpleExclusionTags": true,
"showLocalizationFields": false,
class Forum < ActiveRecord::Base
acts_as_tree
has_many :topics
has_many :posts, :through => :topics
validates_presence_of :title
validates_length_of :title, :within => 3..50
validates_length_of :description, :within => 8..255, :allow_blank => true
end
def primary_and_secondary_nav
return if anonymous? && !allowed?(:navigate_site_anonymously)
items = lis(children_of_nav(:primary),
:selected => lambda { |i| selected_nav?(i) }) do |menu|
link_to_nav(menu)
end
output = ul(items, :id => :primary_nav)
selected = children_of_nav(:primary).detect { |i| selected_nav?(i) }
!.*/(\.[^/]*|CVS|newrelic_rpm|generated|v10|v11|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle)|.*/(creative_file|creative_file_local|ad_files|creative_subimages|bin-debug|log|data|tmp|swftools|asset_file|asset_file_local|whitepapers|tclink\-ruby|perl5|coverage|soap|wsdl|xsd|jruby|creative_subimage|flex_builder_3_sdk|java|mtasc|artwork|public\/assets))$
!(/\.(?!htaccess)[^/]*|tmtags|\.(tmproj|o|pyc)|/Icon\r|/svn-commit(\.[2-9])?\.tmp|production\.sql|\.swf|tclink\.bundle|\.gif|\.png|\.jpg|\.swf|\.fla|\.ico|\.pdf)$