Skip to content

Instantly share code, notes, and snippets.

@mileszs
mileszs / gist:3895572
Created October 15, 2012 21:19
Indy.rb November 2012 Hackfest Idea

Indy.rb November 2012 Hackfest Idea

What

Microframework Hack-off

Wat

We would split into several small groups. Each group would be assigned a different web micro-framework to use to build a blog (or something else, but everyone should be building the same thing). After X amount of time (1 hour?), each group will discuss with the other groups what they liked or did not like about their micro-framework.

@mileszs
mileszs / gist:2385172
Created April 14, 2012 15:18
IndyHackers To-Do List for Indy Hack Day

General

  • Upgrade to the latest Rails (from 3.1 -> 3.2.x)
  • Improve tests, and their coverage (mileszs started here)
  • In-place edit the "what's happening" blurb
  • attr_accessible ... Whoops.
  • Use indyhackersapi.herokuapp.com for calendar on the front page.

Job Board

  • Get rid of the animation thing; just load stuff, like in olden times.
  • Make it work well on mobile devices; integrate Skeleton
@mileszs
mileszs / personality.rb
Created April 12, 2012 18:13 — forked from wycats/personality.rb
More technical details about the discussion at last nights meetup
# Just wanted to clarify my points at the meetup last night.
#
# There were two different issues intertwined:
# (1) Whether to use extend or "include as extend"
# (2) When using "include as extend", what is the simplest way to achieve the goal?
#
# My personal opinion is that the answer to (1) is "extend", not "include as extend", but that
# is just my personal opinion. My answer to (2) is a more empirical question.
# Using the "extend" approach. Again, I personally prefer the simplicity of this approach, but
@mileszs
mileszs / gist:1937093
Created February 29, 2012 02:31
github.com.js
// This requires dotjs
// http://defunkt.io/dotjs/
$('#dashboard .news').hide();
$('#your_repos').css('float', 'left');
$("ul.tabs li a:contains('News Feed')").text("Repos");
# 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 => 'Daley', :city => cities.first)
user = User.create(
:name => 'Magic Johnson',
Gem::Specification.new do |s|
s.name = 'factory_combiner'
s.version = '0.1.0'
s.platform = Gem::Platform::RUBY
s.author = 'Miles Z. Sterrett'
s.email = 'miles@mileszs.com'
s.summary = 'Factory Combiner'
s.description = 'Combine auto-generated factory files into a single file.'
s.files = ['factory_combiner.rb']
class ThingsController < ApplicationController
before_filter :load_thing, :except => :index
def index
# ...
end
def show
# ...
end
# Let's say current_user = the currently logged in user
def update
user = User.find(params[:id])
if current_user.superadmin?
# this is adding stuff to the user's metaclass, which doesn't affect any other User objects
class << user
attr_accessible :email, :password, :password_confirmation, :this, :that, :superadmin
end
end
@mileszs
mileszs / form.html
Created December 14, 2011 03:29 — forked from illbzo1/An example of the form method from a view
Working with form methods in Sinatra
<form method="get" action="/input">
<input type="text" name="input" />
<input type="submit" value="Submit" />
</form>
# US English translations for Ruby on Rails
#
# Use this as the base for the locale file of your language.
# Things in a "formats" section for date or time can be called
# like `Date.today.to_s(:short_us)`, without creating an
# initializer to merge the stuffs.
en:
date: