Skip to content

Instantly share code, notes, and snippets.

View monde's full-sized avatar
🐲

Mike Mondragon monde

🐲
  • Okta
View GitHub Profile
class Publisher < ActiveRecord::Base
include Rails.application.routes.url_helpers
default_url_options[:host] = Rails.application.config.host
belongs_to :application
serialize :options
validates_presence_of :application_id
@monde
monde / foo.rb
Created December 13, 2011 22:33
module Bar
class << self
attr_accessor :foo
end
class Foo
attr_accessor :foo
def initialize
@foo = "foo"
end
@monde
monde / konami.js
Created December 12, 2011 19:50
Konami CSI Miami cheat code for www.hark.com
var keyCodes = [];
$(document).keydown(function(e){
keyCodes.push(e.keyCode);
if(keyCodes.toString().indexOf("38,38,40,40,37,39,37,39,66,65") >= 0){
console.log('Yeaaaaaah!');
$(document).unbind('keydown', arguments.callee);
var pid = 'pndmzxvqkl';
var container = $('#copyright');
$.getJSON('http://www.hark.com/clips/' + pid + '.json', function(data){
var audio = $('<audio>').attr({ 'src': data.url, 'preload': 'auto' });
2011-11-16T13:54:13+00:00 app[app.1]: 16 Nov 13:54:13 - SEND: PONG :fugbot
2011-11-16T13:59:13+00:00 app[app.1]: 16 Nov 13:59:13 - SEND: PONG :fugbot
2011-11-16T14:04:13+00:00 app[app.1]: 16 Nov 14:04:13 - SEND: PONG :fugbot
2011-11-16T14:09:13+00:00 app[app.1]: 16 Nov 14:09:13 - SEND: PONG :fugbot
2011-11-16T14:14:13+00:00 app[app.1]: 16 Nov 14:14:13 - SEND: PONG :fugbot
2011-11-16T14:19:13+00:00 app[app.1]: 16 Nov 14:19:13 - SEND: PONG :fugbot
2011-11-16T14:24:13+00:00 app[app.1]: 16 Nov 14:24:13 - SEND: PONG :fugbot
2011-11-16T14:29:13+00:00 app[app.1]: 16 Nov 14:29:13 - SEND: PONG :fugbot
2011-11-16T14:34:13+00:00 app[app.1]: 16 Nov 14:34:13 - SEND: PONG :fugbot
2011-11-16T14:44:13+00:00 app[app.1]: 16 Nov 14:44:13 - SEND: PONG :fugbot
@monde
monde / README
Created November 8, 2011 22:08
how to build a vagrant box image
= Ubuntu Natty 64 Server Vagrant Base Box
== Description
This is a Vagrant Base Box based upon the Ubuntu Natty 64 Server. It was built
according to the Vagrant Base Box building guide:
http://vagrantup.com/docs/base_boxes.html
This box's main characteristic is the use of Ruby 1.9.2 built from source.
@monde
monde / gist:1327782
Created October 31, 2011 15:40
Convore Exception
Traceback (most recent call last):
File "/home/convore/virtualenvs/convore/lib/python2.6/site-packages/eventlet/wsgi.py", line 336, in handle_one_response
result = self.application(self.environ, start_response)
File "/home/convore/virtualenvs/convore/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 245, in __call__
response = middleware_method(request, response)
File "/home/convore/convore/django_ext/middleware/log.py", line 30, in process_response
'trk': getattr(request, 'trk', None),
File "/home/convore/convore/django_ext/logging.py", line 27, in log_event
if has_session and request.user.is_authenticated():
File "/home/convore/virtualenvs/convore/lib/python2.6/site-packages/django/contrib/auth/middleware.py", line 9, in __get__
$ heroku logs
2011-10-28T12:50:03+00:00 app[app.1]: rooms: [ '383535' ],
2011-10-28T12:50:03+00:00 app[app.1]: account: 'hark1',
2011-10-28T12:50:03+00:00 app[app.1]: domain: 'hark1.campfirenow.com',
2011-10-28T12:50:03+00:00 app[app.1]: authorization: 'Basic N2FlZWRjMjAzMGNiODFkZTg3NDQxNDJhYjk2ZGMwZThkOTI1ODFlMDp4' }
2011-10-28T12:50:03+00:00 app[app.1]: /^CommityMcBot:?\s*(calc|calculate|convert|math)( me)? (.*)/i
2011-10-28T12:50:03+00:00 app[app.1]: /^CommityMcBot:?\s*keep (.*) alive$/i
2011-10-28T12:50:03+00:00 app[app.1]: /^CommityMcBot:?\s*don'?t keep (.*) alive$/i
2011-10-28T12:50:03+00:00 app[app.1]: /^CommityMcBot:?\s*what are you keeping alive/i
@monde
monde / gist:1279860
Created October 12, 2011 00:18 — forked from joevandyk/gist:1279847
refresh css js
javascript:(function(){var img = document.createElement('img'); img.src = "/css-refresh?" + Date.now(); var h,a,f;a=document.getElementsByTagName('link');for(h=0;h<a.length;h++){f=a[h];if(f.rel.toLowerCase().match(/stylesheet/)&&f.href){var g=f.href.replace(/(&|%5C?)forceReload=\d+/,'');f.href=g+(g.match(/\?/)?'&':'?')+'forceReload='+(new Date().valueOf())}};})()
*.notice;authpriv,remoteauth,ftp,install,internal.none /var/log/system.log
kern.* /var/log/kernel.log
# Send messages normally sent to the console also to the serial port.
# To stop messages from being sent out the serial port, comment out this line.
#*.err;kern.*;auth.notice;authpriv,remoteauth.none;mail.crit /dev/tty.serial
# The authpriv log file should be restricted access; these
# messages shouldn't go to terminals or publically-readable
# files.
@monde
monde / watermark.rb
Created August 25, 2011 16:27
imagemagic watermark processor for Paperclip
module Paperclip
class Watermark < Processor
##
# A Paperclip::Processor for watermarking images with imagemagick's
# composite command.
#
# Place this code in lib/paperclip_processors/watermark.rb or into a Rails initializer.
#
# Example: All orginal files are resized to be at most 480 pixels in