Skip to content

Instantly share code, notes, and snippets.

View bobbywilson0's full-sized avatar

Bobby Wilson bobbywilson0

View GitHub Profile
<% @billboard.photos.each do |photo| %>
<div class="modal-container" style="display: none;">
<div class="modal-form">
<%= photo.inspect %>
</div>
</div>
<% end %>
package main
import (
"fmt"
"time"
)
func sum(nums chan int) {
acc := 0
for x := range nums {
acc += x
@bobbywilson0
bobbywilson0 / problem1.go
Created February 24, 2013 05:32
Project Euler - Problem 1 in Go
package main
import (
"fmt"
"time"
)
func section(start int, end int, acc chan int) {
for i := start; i <= end; i++ {
if i % 3 == 0 || i % 5 == 0 {
$('.dropzone').sortable({
update: function() {
console.log($($(this).context).siblings('h4'))
}
})
require 'resolv'
def valid_email_domain(domain)
Resolv::DNS.open do |dns|
mail_servers = dns.getresources(domain, Resolv::DNS::Resource::IN::MX)
if mail_servers && !mail_servers.empty?
true
else
false
end
var seriesCount = 0;
_.each(data, function(values, k) {
var series = _.zip(dates, values);
console.log(seriesCount);
g.append("svg:path")
.style('stroke', d3.scale.category10()(seriesCount))
.attr("d", line(series));
seriesCount++;
});
(function() {
var TS = function(options) {
_.defaults(options, {
width: 300,
height: 210,
margin: 24,
min: 0,
max: 100
});
var timeSeries = TS({
container: '.graph',
dates: ["2011/12/12", "2011/12/13", "2011/12/14", "2011/12/15", "2011/12/16"],
data: {
skiing: [1, 2, 0, 4, 5],
snowboarding: [0, 3, 6, 2, 0]
}
});
VCR.use_cassette('geokit') do
Geokit.geocode('Denver, CO')
end
ruby 1.9.2p280
rake spec 110.95s user 11.04s system 83% cpu 2:25.35 total
ruby 1.9.3p0
rake spec 76.11s user 8.13s system 77% cpu 1:48.27 total