Skip to content

Instantly share code, notes, and snippets.

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
#
# Sphinx/Ultrasphinx user-configurable options.
#
# Copy this file to RAILS_ROOT/config/ultrasphinx. You can use individual
# namespaces if you want (e.g. development.base, production.base,
# test.base). Note that ERb is also allowed.
#
# This file should not be handed directly to Sphinx. Use the rake task
#
# rake ultrasphinx::configure
SELECT content_items.id id, 'ContentItem' AS class, 7 AS class_id, CAST(GROUP_CONCAT(DISTINCT comments.body SEPARATOR ' ') AS CHAR) AS comments, UNIX_TIMESTAMP(content_items.created_at) AS created_at, CONCAT_WS(' ', content_items.description, content_items.filename) AS description, content_items.title AS title, UNIX_TIMESTAMP(content_items.updated_at) AS updated_at FROM content_items JOIN (comments, discussions) ON (content_items.id = discussions.target_id AND discussions.target_type = 'ContentItem' AND comments.discussion_id = discussions.id) GROUP BY content_items.id
HISTFILESIZE=1000000000
HISTSIZE=1000000
PATH="/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin"
# Faster Navigation
alias ll='ls -al'
alias search=grep
alias mc='mc -c'
alias ..='cd ..'
@loe
loe / gist:9847
Created September 10, 2008 07:35
<?php
$gallery_basedir = "/var/www/gallery.andrewloe.com/";
// Gallery requirements
if (!isset($gallery_basedir))
{
$gallery_basedir = './';
}
@loe
loe / gist:10106
Created September 10, 2008 23:44
Event Create (0.000279) INSERT INTO `events` (`event_category_id`, `verb`, `target_id`, `info`, `obfuscated_id`, `actor_id`, `notifications_made`, `send_to_salesforce`, `system_only`, `deleted`, `actor_type`, `target_type`, `created_at`, `detail`) VALUES(6, 'create', 164, '', 'e80adad2fd472530ab7d7c22aef24e012ef71d83', 2, 0, 1, 0, 0, 'User', 'Hub', '2008-09-10 23:44:17', '$0 poked the Hub $1')
WARN: publish_to_queue on line 192 of /Users/Andrew/Projects/macchiato/app/models/event.rb:
Wed Sep 10 16:44:17 -0700 2008: HEY THIS SHOULD HAPPEN AFTER EVENT PARTS!
SQL (0.000605) COMMIT
EventPart Columns (0.001536) SHOW FIELDS FROM `event_parts`
SQL (0.000083) BEGIN
EventPart Create (0.000185) INSERT INTO `event_parts` (`event_id`, `obj_type`, `obj_id`, `order`, `obfuscated_id`, `deleted`) VALUES(2393, 'User', 2, 0, 'f4df422e662da8e9829d93137a164b15879d4db6', 0)
SQL (0.000637) COMMIT
SQL (0.000511) BEGIN
EventPart Create (0.000282) INSERT INTO `event_parts` (`event_id`, `obj_ty
@loe
loe / gist:10950
Created September 15, 2008 21:52
fullname = "W. Andrew Loe III"
split_name = fullname.split
first_name = split_name.delete_at(0)
last_name = split_name.join(" ")
@loe
loe / gist:11179
Created September 17, 2008 01:37
ThePlanet.com in Dallas:
andrew@switch:~$ traceroute www.wpromote.com
traceroute to www.wpromote.com (69.80.221.67), 30 hops max, 40 byte packets
1 91.4f.5d45.static.theplanet.com (69.93.79.145) 0.963 ms 1.221 ms 1.429 ms
2 vl1.dsr01.dllstx2.theplanet.com (12.96.160.9) 0.434 ms 0.490 ms 0.524 ms
3 te9-4.dsr01.dllstx3.theplanet.com (70.87.253.117) 0.467 ms 0.512 ms 0.554 ms
4 et5-1.ibr04.dllstx3.theplanet.com (70.87.253.13) 0.475 ms 0.533 ms 0.578 ms
5 te-3-1.car4.Dallas1.Level3.net (4.71.122.1) 1.228 ms 1.257 ms 1.302 ms
6 vlan79.csw2.Dallas1.Level3.net (4.68.19.126) 12.309 ms 12.115 ms 11.848 ms
7 ae-73-73.ebr3.Dallas1.Level3.net (4.69.136.157) 2.803 ms 2.798 ms 2.777 ms
@loe
loe / gist:12446
Created September 24, 2008 00:39
if user.salesforce_information.is_a?(Hash)
lead.leadSource = user.salesforce_information[:source] if user.salesforce_information[:source]
lead.search_engine__c = user.salesforce_information[:search_engine] if user.salesforce_information[:search_engine]
lead.keyword__c = user.salesforce_information[:keyword] if user.salesforce_information[:keyword]
lead.lead_offer__c = user.salesforce_information[:offer] if user.salesforce_information[:offer]
end
Hub.for_user_clean(current_user).collect{|hub| hub.owner.enhanced_security_allowed?}.any?
#this will loop through all hubs I want to short circuit as soon as the block is true for any.
# something like this but I can't quite get the syntax right
Hub.for_user_clean(current_user).collect{|hub| true && break if hub.owner.enhanced_security_allowed?}