Skip to content

Instantly share code, notes, and snippets.

View mculp's full-sized avatar
🎨
arting

Matt Culpepper mculp

🎨
arting
  • Mississippi
  • 16:55 (UTC -05:00)
  • X @mculppp
View GitHub Profile
#!/usr/bin/env ruby
require 'nokogiri'
require 'open-uri'
require 'openssl'
require 'rubygems'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
doc = open('https://www.coinmarket.io/market/LEAFBTC').read
@mculp
mculp / gist:8962758
Created February 12, 2014 19:28
new gaming puter
Motherboard & CPU
ASRock Fatal1ty 990FX Killer AM3+ AMD 990FX SATA 6Gb/s USB 3.0 ATX AMD Motherboard
http://www.newegg.com/Product/ComboDealDetails.aspx?ItemList=Combo.1548261
$280
Corsair Carbide Series 500R Arctic White Steel / Plastic ATX Mid Tower Gaming Case
http://www.newegg.com/Product/Product.aspx?Item=11-139-010
$120 ($20 rebate available)
Rosewill BRONZE Series RBR1000-M 1000W Continuous@40°C, 80Plus Bronze Certified,Modular Cable Design Power Supply
@mculp
mculp / haproxy.cfg
Last active August 29, 2015 13:56
haproxy setup
listen multi :6667
mode tcp
option tcplog
acl use_ruby payload(0,50) -i jimmyneutron
# acl use_ruby payload(0,50) -m sub jimmyneutron
# acl use_ruby payload(0,50) -m reg jimmyneutron
use-server ruby if use_ruby
server diamond 127.0.0.1:3420 check
@mculp
mculp / potcoin.json
Created May 2, 2014 01:48
potcoin peer nodes
[
{
"addr" : "107.170.32.10:4200",
"services" : "00000003",
"lastsend" : 1398995130,
"lastrecv" : 1398995130,
"bytessent" : 1085124,
"bytesrecv" : 2291856,
"blocksrequested" : 163,
"conntime" : 1398856332,
@mculp
mculp / 0_reuse_code.js
Last active August 29, 2015 14:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
>> a = OpenStruct.new
=> #<OpenStruct>
>> h = OpenStruct.new
=> #<OpenStruct>
>> h.a = a
=> #<OpenStruct>
>> a.h = h
=> #<OpenStruct a=#<OpenStruct h=#<OpenStruct ...>>>
>> h.a.h.a.h.a.h.a.h.a.h.a.h.a.h.a.h
=> #<OpenStruct a=#<OpenStruct h=#<OpenStruct ...>>>
>> nineeleven = Date.parse('9/11/2001')
=> Tue, 11 Sep 2001
>> earthquake = Date.parse('3/10/2011')
=> Thu, 10 Mar 2011
>> Date.parse("#{nineeleven.month + earthquake.month}/#{nineeleven.day + earthquake.day}/#{nineeleven.year + earthquake.year - 2000}")
=> Fri, 21 Dec 2012
# aw fuck
>> c = CarSearch.last
=> #<CarSearch id: 906, start_date_time: "2011-03-30 12:00:00", ...>
>> cs = c.clone
=> #<CarSearch id: nil, start_date_time: "2011-03-30 12:00:00", ...>
>> cs.attributes
=> {"start_date_time"=>Wed Mar 30 12:00:00 -0500 2011, ...}
>> cs.read_attribute :start_date_time
activerecord:
errors:
messages:
some_blank_message: "Shit be blank"
mculp:rails matthew$ gem build rails.gemspec
Successfully built RubyGem
Name: rails
Version: 3.1.0.beta
File: rails-3.1.0.beta.gem
mculp:rails matthew$ rake install
(in /Users/matthew/work/rails)
(in /Users/matthew/work/rails/activesupport)
(in /Users/matthew/work/rails/activemodel)