Skip to content

Instantly share code, notes, and snippets.

View gbelote's full-sized avatar
🎩
Workin' on Wefunder

Greg Belote gbelote

🎩
Workin' on Wefunder
View GitHub Profile
diff --git a/config.ru b/config.ru
index 4e0416f..ce264ca 100644
--- a/config.ru
+++ b/config.ru
@@ -1,4 +1,5 @@
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
+use Rack::Deflater if ENV['enable_gzip'] == "true"
run Crowdly::Application
@gbelote
gbelote / a.rb
Created June 28, 2012 11:02
undefined method `read_attribute_for_validation' for nil:NilClass
class A < ActiveRecord::Base
attr_accessible :data
serialize :data, B
validate :custom
def custom
errors.add :data, "whoopsies!" unless data.valid?
end
end
@gbelote
gbelote / index.html
Created June 19, 2012 12:34
HTML Example for Dave
<html>
<head>
<title>Whatever Title You Want</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
// wait until the page is ready (i.e. loaded) before binding events
$(function() {
// whenever someone clicks on an <area> element...
$ git diff github/citi_master..production/master
@gbelote
gbelote / app.js
Created March 6, 2011 21:12
Start a server on port 3000 with socket.io
var express = require('express');
var io = require('socket.io');
var app = express.createServer();
app.get('/', function(req, res){
res.send("<html><head><script src='/socket.io/socket.io.js'></script></head></html>");
});
app.listen(3000);
// Start timing the load speed of mar.gy
_margyStartTime = new Number( new Date() );
(function() {
var margy = document.createElement('script'); margy.type = 'text/javascript'; margy.async = true;
margy.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://cdn') + '.mar.gy/javascripts/widget/insert_widget.js';
var s = document.getElementsByTagName('script')[0];
setTimeout( function() { s.parentNode.insertBefore(margy, s); }, 10 );
diff --git a/app/views/site/index.html.haml b/app/views/site/index.html.haml
index 909646a..1028595 100644
--- a/app/views/site/index.html.haml
+++ b/app/views/site/index.html.haml
@@ -44,7 +44,7 @@
:javascript
var addthis_config = {
- ui_email_note: 'I thought you'd be interested in checking out www.Appswell.com. It's a place to view and share iPhone app ideas, and submit your own idea for a chance to see it made.'
+ ui_email_note: 'I thought you\'d be interested in checking out www.Appswell.com. It\'s a place to view and share iPhone app ideas, and submit your own idea for a chance to see it made.'
<!-- BEGIN Marginize -->
<script type="text/javascript" id="Margy-Publisher-Widget">
// Start timing the load speed of mar.gy
_margyStartTime = new Number( new Date() );
(function() {
var margy = document.createElement('script'); margy.type = 'text/javascript'; margy.async = true;
margy.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://cdn') + '.mar.gy/javascripts/widget/insert_widget.js';
<!-- BEGIN Marginize -->
<script type="text/javascript">
// Start timing the load speed of mar.gy
_margyStartTime = new Number( new Date() );
(function() {
var margy = document.createElement('script'); margy.type = 'text/javascript'; margy.async = true;
margy.src = 'http://cdn.mar.gy/javascripts/widget/insert_widget.js';
<!-- BEGIN Marginize -->
<script type="text/javascript">
// Start timing the load speed of mar.gy
_margyStartTime = new Number( new Date() );
(function() {
var margy = document.createElement('script'); margy.type = 'text/javascript'; margy.async = true;
// TODO: switch to subdomain and support SSL