Skip to content

Instantly share code, notes, and snippets.

@taylor01
taylor01 / rails http status codes
Created April 5, 2021 11:51 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
<meta content="2019 Dave Matthews Band at AFAS Live by Pavlov Visuals | The Art Exchange" property="og:title"></meta>
<meta content="The Art Exchange is an online community to track, buy, and sell artwork" property="og:description"></meta>
<meta content="https://theartexch.com/artworks/1880" property="og:url"></meta>
<meta content="/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBcndIIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--2515844370b6bc93431d8565adf30b21ea7f243c/dmap825.jpg" property="og:image"></meta>
<meta content="2019 Dave Matthews Band at AFAS Live by Pavlov Visuals | The Art Exchange" name="title"></meta>
<meta content="The Art Exchange is an online community to track, buy, and sell artwork" name="description"></meta>
<link href="/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBcndIIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--2515844370b6bc93431d8565adf30b21ea7f243c/dmap825.jpg" rel="image_src"></link>
<meta content="twitter summary" name="twitter:card"></meta>
<meta conten
@taylor01
taylor01 / gist:acd45287f15af7ff71e9c05edbb5803d
Created August 31, 2017 15:44
Postgres Array attribute migration
class AddLocationToVisitObservation < ActiveRecord::Migration[5.1]
def change
add_column :visit_observations, :location, :text, array:true, default: []
end
end
Visitor Visits visit_observation
"hash_mac" visitor_id visit_id:integer
"location_id" first_seen_at lat:float
"os" last_seen_at lng:float
"manufacturer" max_rssi unc:integer
ipv4 location:array [['lat', 'lng', 'unc'], ['lat', 'lng', 'unc']]
ipv6
ssid
seen_epoch
class SalesHistoryImporter
require 'csv'
def import(file)
@filename = File.basename(file)
@file = open(file)
if !check_file_name(file)
return false
end
require 'open-uri'
require 'net/http'
(1..1000).each do |n|
uri = URI("http://static.musictoday.com/store/bands/6/product_large/DMAP#{n}.JPG")
request = Net::HTTP.new uri.host
response = request.request_head uri.path
@taylor01
taylor01 / gist:2cf5a1834ec23fe024b6
Last active August 29, 2015 14:19
teamhendrick.com photo.asp
<%@ Language=VBScript %>
<%
pageTitle = "Photos"
pageName = "photos"
%>
<!--#include file="include/i_header.asp"-->
<!--Content Start - 650 px wide-->

Keybase proof

I hereby claim:

  • I am taylor01 on github.
  • I am taylor01 (https://keybase.io/taylor01) on keybase.
  • I have a public key whose fingerprint is 8079 6CD5 2DAE C450 1D7C 8E49 9EA5 3BD2 AFAF 4AE9

To claim this, I am signing this object:

@taylor01
taylor01 / gist:8120499
Created December 25, 2013 05:45
Heroku Middleman Configuration with Travis-ci
language: ruby
rvm:
- 2.0.0-p247
script: bundle exec middleman build
deploy:
provider: heroku
api_key:
secure: <secure heroku auth key>
@taylor01
taylor01 / gist:6716726
Created September 26, 2013 16:35
Extend Linux Disks in VMWare
1. Extended in VMWare first
2. Boot VM from Unbuntu live CD. Make sure to use Desktop version and not Server
3. Launch GParted from the live CD.
4. Re-arrange/extend partitions.
5. Reboot VM.