Skip to content

Instantly share code, notes, and snippets.

💭
skiing

ara.t.howard ahoward

Block or report user

Report or block ahoward

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View -
show = proc do |a|
"#{ a.class.name }[account: #{ a.account.slug.inspect }, name: #{ a.name.inspect }, id: #{ a.id }]"
end
audience = Audience.where(:id => '5a87337cbfe1a449740024db').first
audience.destroy
puts "DESTROY: #{ show[audience] }"
puts
Audience.all.each do |doc|
View -
show = proc do |a|
"#{ a.class.name }[account: #{ a.account.slug.inspect }, name: #{ a.name.inspect }, id: #{ a.id }]"
end
audience = Audience.where(:id => '5a87337cbfe1a449740024db').first
audience.destroy
puts "DESTROY: #{ show[audience] }"
puts
Audience.all.each do |doc|
@ahoward
ahoward / json_rpc.rb
Created Jan 31, 2018
all the ruby json rpc gems suck so i made this teeny one. put it in lib/json_rpc.rb
View json_rpc.rb
# ref: http://www.jsonrpc.org/specification
#
# stdlibs
#
require 'net/http'
# gems
#
require 'addressable/uri'
View g.rb
class WebpackController < ApplicationController
include ReverseProxy::Controller
# https://stackoverflow.com/questions/10883211/deadly-cors-when-http-localhost-is-the-origin
#
layout false
HEADERS =
{
#
View a.rb
=begin
- if we just add a field we need to
- avoid adding 'home away properties' to the SearchLocation table
file: app/models/search_location.rb
View a.yml
---
55e9bb414ebabf7667000022:
created_at: 2015-09-04 15:39:45.888000000 Z
updated_at: 2017-08-15 22:43:17.349000000 Z
55f193104ebabf6a5300000f:
created_at: 2015-09-10 14:26:24.925000000 Z
updated_at: 2015-09-10 14:28:02.648000000 Z
55f2d9f74ebabf47b6000013:
created_at: 2015-09-11 13:41:11.380000000 Z
updated_at: 2015-09-11 15:08:55.310000000 Z
@ahoward
ahoward / a.rb
Created Apr 18, 2017
categorize your taxes in a hurry with this ruby script!
View a.rb
#! /usr/bin/env ruby
require 'csv'
require 'pp'
require 'readline'
require 'fileutils'
require 'rubygems'
require 'main'
@ahoward
ahoward / a.rb
Last active Dec 16, 2016
using sass expressions and all your rails' sass helpers in erb / eruby
View a.rb
module ApplicationHelper
# <%= sass_eval 'opacify($red, 0.6)' %>
def sass_eval(expr)
css = ::Sass.compile("#value { value: #{ expr }; }") # ".value {\n value: $sass_processed_arg; }\n"
css.split('value:', 2).last.split(';', 2).first.strip
end
end
@ahoward
ahoward / a.rb
Last active Dec 2, 2016
skip bower / bower_components during 'rails assets:precompile'
View a.rb
config = Rails.application.config
default_precompile = config.assets.precompile
config.assets.precompile = [
proc do |path|
if path =~ /bower_components/
false
else
default_precompile.call(path)
View assassin.rb
require 'tmpdir'
require 'securerandom'
class Assassin
def Assassin.ate(*args, &block)
new(*args, &block)
end
attr_accessor :parent_pid
attr_accessor :child_pid
You can’t perform that action at this time.