Skip to content

Instantly share code, notes, and snippets.

View ryanatwork's full-sized avatar

Ryan Resella ryanatwork

View GitHub Profile
@ryanatwork
ryanatwork / parsely.rb
Created January 10, 2014 23:29
Parsely Meta Tag Ruby Example
require 'date'
title = "Zipf's Law of the Internet: Explaining Online Behavior"
link = "http://blog.parsely.com/post/57821746552"
image_url = "http://blog.parsely.com/inline_mra670hTvL1qz4rgp.png"
section = "Programming"
author = "Alan Alexander Milne"
pub_date = Time.new(2012,1,1,11,34,2, '-05:00')
tags = ["statistics", "zipf", "internet", "behavior"]
@ryanatwork
ryanatwork / seeds.rb
Created September 21, 2012 17:40
State Model
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)
State.create([{name: 'Alabama', abbreviation: 'AL'},
@ryanatwork
ryanatwork / gist:2880008
Created June 6, 2012 04:54
Rails Admin Error on Heroku
2012-06-06T04:52:28+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 35015`
2012-06-06T04:52:47+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2012-06-06T04:52:47+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at
@ryanatwork
ryanatwork / Brigade.rb
Created May 2, 2012 19:06
Admin for Brigade
a = User.find_by_email('kevin@codeforamerica.org')
a.admin = true
a.save
@ryanatwork
ryanatwork / _nav.html.haml
Created January 22, 2012 03:21
Bootstrap Menu in HAML
.topbar-wrapper{:style => "z-index: 5;"}
.topbar{"data-dropdown" => "dropdown"}
.topbar-inner
.container
%h3
= link_to 'Project', root_path
%ul.nav
%li
= link_to 'Home', '#', {:class => 'active'}
%li
@ryanatwork
ryanatwork / wattupdog.js
Created October 18, 2011 21:35
Wattup dog
say("Hello....", {voice:"simon"});
say("......");
say("yes.....", {voice:"simon"});
say("......");
say("this is dog", {voice:"simon"});
@ryanatwork
ryanatwork / closest.ruby
Created September 28, 2011 04:19
Closest one
require 'sinatra'
require 'json'
require 'net/http'
require 'haml'
require 'geocoder'
get '/' do
b = JSON.parse(Net::HTTP.get(URI.parse("http://data.cityofchicago.org/api/views/nen3-vcxj/rows.json")))
us = [41.864447,-87.644806]
@ryanatwork
ryanatwork / Newfile.cs
Created August 24, 2011 20:58
ParseDates
protected string ParseDate(DateTime startDate, DateTime endDate)
{
string temp;
//Don't show times if 12:00 AM
bool showStartTime = false;
bool showEndTime = false;
if (DateTime.Parse(startDate.ToShortTimeString()) != DateTime.Parse("12:00 AM"))
{
showStartTime = true;
if (DateTime.Parse(endDate.ToShortTimeString()) != DateTime.Parse("12:00 AM"))
@ryanatwork
ryanatwork / browse.asp
Created August 24, 2011 05:45
Browse SQL Server Jobs
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim strConn
strConn = "YOUR CONNECTION STRING HERE"
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open(strConn)
We couldn’t find that file to show.