Skip to content

Instantly share code, notes, and snippets.

$r = new HydraRouter();
$r->dispatch("/", function() use ($env, $db) {
$result = $db->execute("SELECT (1 + 1) AS count");
$view = new HyrdaView("app/views/application.php");
list($header, $body) = $view->html(
"app/views/home.php",
array( "result" => $result ));
require 'digest/sha2'
require 'base64'
module Digraph
def identifier(*args)
args.join('|')
Base64.encode64(Digest::SHA2.hexdigest(args.join))
end
class Node
set nocompatible
" Use pathogen to easily modify the runtime path to include all
" plugins under the ~/.vim/bundle directory
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
" change the mapleader from \ to ,
let mapleader=","
<?
require "_application.php";
hydra_import_package("HydraDispatch");
$d = new HydraDispatch();
$d->dispatch("/", function($r) use ($d, $db) {
$result = $db->execute("SELECT (1 + 1) AS count");
This is a rough draft. Straight from the notes I took during the first meeting.
TNR stands for Trap Nueter Return
They processed over 400 cats in the month of January.
The scope of the problem would require over 1000 cats to processed every week. That number would require a 2 million dollar annual budget.
Roles inside of the organization:
Trapper
Coordinators
<% Rails.cache.write('pj_products', :expires => 12.hours) do %>
<% products = cj.product_search('keywords' => "", 'advertiser-ids' => '', 'serviceable-area' => '', 'currency' => '', 'records-per-page' => '')) %>
<% products.each do |product| %>
<%= product.inspect %>
<% end %>
<% end %>
class Card
def self.random(count)
case ActiveRecord::Base.connection.adapter_name.downcase
when "mysql"
order("RAND()").limit(count)
else
order("RANDOM()").limit(count)
end
end
end
$(".map-marker").each(function() {
var title = $(this).data("title")
var lat = $(this).data("lat")
var lng = $(this).data("lng") var marker = new google.maps.Marker({
class ConvertDatabaseToUtf8 < ActiveRecord::Migration
def self.up
db_config = ActiveRecord::Base.connection.instance_values["config"]
db_name = db_config[:database]
db_user = db_config[:username]
db_pass = db_config[:password] || ''
latin1_dump = 'latin1_dump.sql'
utf8_dump = 'utf8_dump.sql'
function OnLoad() {
try {
var distances = [];
if (google.loader.ClientLocation) {
for (var i in cities) {
lat1 = cities[i].lat;
lon1 = cities[i].lng;
dLat = (google.loader.ClientLocation.latitude - lat1).toRad();