Skip to content

Instantly share code, notes, and snippets.

View davidcelis's full-sized avatar
Verified account

David Celis davidcelis

Verified account
View GitHub Profile
@davidcelis
davidcelis / ruby-on-ales.markdown
Created March 1, 2012 17:51
Overview of talks given at Ruby on Ales

Ruby on Ales

Outgrowing the Cloud (Mike Moore)

  • Requests hitting the same load balancer can't handle HTTP and HTTPS at the same time because of SSL issues
  • If you are trying to access an outside resource behind a firewall, you have to tell them every time you get a new webserver so they can whitelist the new IP
  • If you know the IPs of your web servers and database servers, you can have requests hit these directly and bypass the load balancers.
  • Could buy your own data center, but then you have to buy a load balancing router. Those are fucking expensive (tens or hundreds of thousands of dollars)
_______________________________________
/ One of the most striking differences \
| between a cat and a lie is that a cat |
| has only nine lives. |
| |
| -- Mark Twain, "Pudd'nhead Wilson's |
\ Calendar" /
---------------------------------------
\ ^__^
\ (oo)\_______
User.has_many :memberships
User.has_many :groups, :through => :memberships
Membership.belongs_to :user
Membership.belongs_to :group
Group.has_many :memberships
Group.has_many :users, :through => :memberships
>> current_user.memberships # => Gives you the Join models. No idea why you'd need them, but there they are
@davidcelis
davidcelis / config.ru
Created March 6, 2012 18:35
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin`
# Be sure to have rails and thin installed.
require "rubygems"
# We are not loading Active Record, nor the Assets Pipeline, etc.
# This could also be in your Gemfile.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
# The following lines should come as no surprise. Except by
@davidcelis
davidcelis / test-plugin
Created March 9, 2012 18:36
The default file structure of a --full --mountable Rails::Engine.
├── app
│   ├── assets
│   │   ├── images
│   │   │   └── test-plugin
│   │   ├── javascripts
│   │   │   └── test-plugin
│   │   │   └── application.js
│   │   └── stylesheets
│   │   └── test-plugin
│   │   └── application.css
@davidcelis
davidcelis / gist:2128441
Created March 19, 2012 23:32 — forked from marcel/gist:2100703
giftube – Generates an animated gif from a YouTube url.
#!/usr/bin/env ruby
# giftube – Generates an animated gif from a YouTube url.
#
# Usage:
#
# giftube [youtube url] [minute:second] [duration]
#
# ex.
#
@davidcelis
davidcelis / crazy_email.markdown
Last active October 2, 2015 17:38
Crazy email I got

This is a really weird email that I received on April 1st, 2012 from an unknown sender 233558938299@dysgo.org. The email passed by Google's spam filters and found its way directly into my inbox. At first, I thought it was an elaborate April Fool's Day prank. Maybe it is. However, a tiny bit of research into the email address shows that people believe this to be a mass email sent periodically by a paranoid schizophrenic man from Japan. The email consisted only of the following 100 images arranged in this order. The text of the last image can be found at the end.

image image image image image image image image

@davidcelis
davidcelis / emoji.txt
Created April 3, 2012 20:59 — forked from stephencelis/emoji.txt
Emoji not on the iOS Keyboard
2139 ℹ INFORMATION SOURCE
23EB ⏫ BLACK UP-POINTING DOUBLE TRIANGLE
23EC ⏬ BLACK DOWN-POINTING DOUBLE TRIANGLE
23F0 ⏰ ALARM CLOCK
23F3 ⏳ HOURGLASS WITH FLOWING SAND
26C5 ⛅ SUN BEHIND CLOUD
26D4 ⛔ NO ENTRY
2705 ✅ WHITE HEAVY CHECK MARK
2753 ❓ BLACK QUESTION MARK ORNAMENT
2757 ❗ HEAVY EXCLAMATION MARK SYMBOL
.input-append
= text_field_tag 'Search', nil, :placeholder => 'Search'
%button.btn
%i.icon-search
@davidcelis
davidcelis / syntax_highlighting.py
Created April 12, 2012 22:05 — forked from phillipkoebbe/syntax_highlighting.py
Syntax highlight switcher for Sublime Text 2
import sublime, sublime_plugin
import os, string, re
class DetectFileTypeCommand(sublime_plugin.EventListener):
""" Attempts to choose the correct syntax when more than one could apply. """
def __init__(self):
super(DetectFileTypeCommand, self).__init__()
self.path = None