Skip to content

Instantly share code, notes, and snippets.

View thoughtpunch's full-sized avatar
💸
Hiring with AI @ Dover

Dan Barrett thoughtpunch

💸
Hiring with AI @ Dover
View GitHub Profile
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
content_id,workspace,channel,account,moment_title,moment_scheduled_at,post_name,post_type,content,scheduled_at,created_at,array_agg
6,atlas,Facebook,Atlas,Late Night Setist,2020-06-14 07:00:00,Facebook Post 1,standard,,,2018-07-12 21:24:21.119815+00:00,"[""https://res.cloudinary.com/opal/image/upload/v1531430716/jorik-blom-366499-unsplash_cnxxtc.jpg"", ""https://res.cloudinary.com/opal/image/upload/v1531430718/adult-barista-beverage-373639_two3g0.jpg"", ""https://res.cloudinary.com/opal/image/upload/v1531430718/daniel-gonzalez-602445-unsplash_popvcg.jpg"", ""https://res.cloudinary.com/opal/image/upload/v1531430719/coffee-cup-milk-7034_niulcj.jpg"", ""https://res.cloudinary.com/opal/image/upload/v1531430719/devin-avery-600578-unsplash_u1kocp.jpg"", ""https://res.cloudinary.com/opal/image/upload/v1531430722/marion-michele-330691-unsplash_eoqndu.jpg"", ""https://res.cloudinary.com/opal/image/upload/v1531430719/nathan-dumlao-290152-unsplash_lof1xl.jpg"", ""https://res.cloudinary.com/opal/image/upload/v1531430725/
@thoughtpunch
thoughtpunch / Gemfile
Created June 20, 2014 00:30
Dan Barrett Gemfile
gem "devise" # Authentication
gem "cancan" # Authorization
gem "omniauth" # OAuth providers
# JS Libs
#
gem 'coffee-rails', '~> 4.0.0'
gem 'underscore-rails'
# Global Config/Settings

Keybase proof

I hereby claim:

  • I am thoughtpunch on github.
  • I am thoughtpunch (https://keybase.io/thoughtpunch) on keybase.
  • I have a public key whose fingerprint is 0B80 D1C9 BCEA C8B3 EEF6 32D7 45DD 4038 F3DF D8C8

To claim this, I am signing this object:

@thoughtpunch
thoughtpunch / most_common_word.rb
Created February 25, 2014 00:26
Ruby Homework Problem - Most common word in list
# DANS METHOD + EXPLANATION - LETS TAKE A LOOK AT HOW THIS WORKS
# lets start with a string
string = "Joe is a cool dude. I am also a cool dude. Cool dudes are the best."
# lets clean it up by removing punctuation and lowercasing everything.
# - remember 'Dude' does not equal 'dude' nor 'dUdE', etc. String comparison is exact!
# - the '/\W/' is a regex command that matches all non-letters and numbers. 'gsub' replaces those matches with something, in
# this case, it's an empty space
string.downcase.gsub(/\W/,' ')
@thoughtpunch
thoughtpunch / gist:7416028
Created November 11, 2013 16:29
My .zshrc
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
@thoughtpunch
thoughtpunch / gist:6513951
Created September 10, 2013 18:56
Skeleton for multi-modal wizard with Rails, Bootstrap, and JQuery
// The HAML markup for the modals. Assumes inclusion of 'aria' data attributes
#step_1.modal{aria-hidden: false}
%p Step 1 Form
%form{ remote: :true, id: "horse_form" }
%label "What's your favorite horse?"
%input{type: :text} :favorite_horse
=link_to "Continue to Step #2", "#step_2", {data: {toggle: "modal"}, id:"modal_submit"}
#step_2.modal
@thoughtpunch
thoughtpunch / failed_delayed_job
Created June 19, 2013 19:57
Failed DelayedJob that won't fully unlock, YAML-fied for viewing pleasure
--- !ruby/ActiveRecord:Delayed::Backend::ActiveRecord::Job
attributes:
id: 717
priority: 0
attempts: 0
handler: |+
--- !ruby/object:Delayed::PerformableMethod
args: []
method_name: :fail_real_hard
class ToDoList
def initialize
puts "What's your name, good sir?"
name = gets.strip
puts greeting(name) #this uses the greeting below
puts "1.) Make A To-Do List \n2.) Load A To-Do List\n"
while do_action = gets.chomp
case do_action
@thoughtpunch
thoughtpunch / duplicate_writers.rb
Created February 14, 2012 20:31
A query to get all the writer duplicates as well as their writing credit counts
def duplicate_writers(artist_list)
FasterCSV.open("duplicate_writers_report.csv", "wb") do |csv|
csv << ["WRITER_ID","WRITER_NAME","ARTIST_BAND","WRITER_PRO_ID","WRITER_PRO_NUMBER","WRITING_CREDITS_COUNT"]
artist_list.each do |id|
artist = User.find(id)
writer_names = artist.writers.collect {|writer| writer.old_name.gsub(/\W+/,"").downcase}
artist.writers.each do |person|
#make their name downcase
@thoughtpunch
thoughtpunch / random_nil_hash.rb
Created December 12, 2011 18:58
A Better Way to iterate through arrays/hashes with nils?
#Let say I'm getting back a JSON nested hash (or array of hashes) from an API
@example = {"results" = > {{"poop" => "shoop"},{"foo" => {"shizz" => "fizz", "nizzle"=>"bizzle"}}}
# YAML VIEW OF ABOVE
#- poop: shoop
#- foo:
# shizz: fizz
# nizzle: bizzle