Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am billsaysthis on github.
* I am billsaysthis (https://keybase.io/billsaysthis) on keybase.
* I have a public key ASDmnFF0xXoqPghmRVJms6VnKGZclXaaEAkaAhTTTKQ1WAo
To claim this, I am signing this object:
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-pages/core-pages.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<polymer-element name="my-element">
<template>
@billsaysthis
billsaysthis / grunt-watch-reference.sh
Created May 31, 2013 19:08
Problem with running grunt watch
$ grunt watch
>> Local Npm module "grunt-contrib-watch" not found. Is it installed?
>> Local Npm module "grunt-contrib-compass" not found. Is it installed?
Warning: Task "watch" not found. Use --force to continue.
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
@billsaysthis
billsaysthis / tonotdo-simple.zsh-theme
Created March 14, 2013 21:07
Variation of Toon's (https://github.com/To1ne) Oh-My-Zsh tonotdo theme, features a simpler prompt.
PROMPT='%{$fg_no_bold[green]%}%3~$(git_prompt_info)%{$reset_color%}» '
RPROMPT='[%*]'
# git theming
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}("
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[blue]%})"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[magenta]%}✗%{$fg_bold[blue]%})"
# LS colors, made with http://geoff.greer.fm/lscolors/
@billsaysthis
billsaysthis / tw2wp-generic.rb
Created September 28, 2012 21:47
OSX terminal script to post tweets to a WordPress blog
#!/usr/bin/ruby
require 'rubygems'
# https://github.com/nu7hatch/gmail
require 'gmail'
# https://github.com/sferik/twitter
require 'twitter'
def mail_tweet(gmail, tid, subj)
if !gmail.logged_in?
@billsaysthis
billsaysthis / gist:2346669
Created April 9, 2012 21:28
Backbone with TB2 modal sample View class
ZPCommon.Views.SocialSharesView = Backbone.View.extend({
template: 'public/common/socialShares_hb',
id: 'socialShares',
className: 'buttonBox',
initialize: function() {
_.bindAll(this, 'emailShare');
},
events: {
'click #emailShareBtn': 'emailShare'
},
@billsaysthis
billsaysthis / gist:2254144
Created March 30, 2012 19:09
LayoutManager jQuery plugin question code sample
Public.Views.StarQuestionView = Backbone.View.extend({
template: 'public/common/questions/starQuestion_hb',
className: 'questionContainer'
});
Public.Form = Backbone.View.extend({
...
questionView: function(question, questionNumber) {
@billsaysthis
billsaysthis / event.rb
Created January 16, 2012 20:24
Odd issue with rails_admin configuration
class Event < ActiveRecord::Base
has_many :presentations
has_many :speakers, :through => :presentations
EVT_ACTIVE_STATUSES = %w(on_sale at_door)
EVT_INACTIVE_STATUSES = %w(sold_out past)
...
def status_enum
var auth_middleware = function() {
return function(req, res, next) {
var urlp= url.parse(req.url, true)
if( urlp.query.login_with ) {
req.authenticate([urlp.query.login_with], function(error, authenticated) {
if( error ) {
// Something has gone awry, behave as you wish.
console.log( error );
res.end();
} else {
@billsaysthis
billsaysthis / SmartMonth-stack-trace
Created May 6, 2011 16:24
SmartMonth stack trace
Pow can’t start your application.
/Users/billlazar/Sites/SmallCommunities raised an exception during boot.
SyntaxError: /Users/billlazar/.rvm/gems/ruby-1.9.2-p136@ruby-1.9.2-head/gems/smart_month-1.0.0/lib/smart_month/rulesets.rb:124: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n'
when :date: qry = "Date.new(#{data[:year...
^
/Users/billlazar/.rvm/gems/ruby-1.9.2-p136@ruby-1.9.2-head/gems/smart_month-1.0.0/lib/smart_month/rulesets.rb:125: syntax error, unexpected keyword_when, expecting keyword_end
when :freq: qry = 'true'
^
/Users/billlazar/.rvm/gems/ruby-1.9.2-p136@ruby-1.9.2-head/gems/smart_month-1.0.0/lib/smart_month/rulesets.rb:151: syntax error, unexpected keyword_end, expecting $end
/Users/billlazar/.rvm/gems/ruby-1.9.2-p136@ruby-1.9.2-head/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'