Skip to content

Instantly share code, notes, and snippets.

Frank Licea flsafe

  • Austin
Block or report user

Report or block flsafe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SampleRoute.txt
-106.4930386454095,31.75567039469036,0
-106.4933067789597,31.75559907548127,0
-106.4935185215678,31.7555546939303,0
-106.4937444379161,31.75548291296306,0
-106.4936977010694,31.75529720909734,0
-106.4935596464942,31.75511143605309,0
-106.4935513241208,31.75509688691311,0
-106.4933316389852,31.75497188353929,0
-106.4930651746005,31.75477986665801,0
-106.492657129873,31.75461401608551,0
View gist:1548839
SOAP request: https://gateway.cygnustrack.com/Gateway.asmx
SOAPAction: "http://YourDomainName.com/PostDeviceMessage", Content-Type: text/xml;charset=UTF-8, Content-Length: 1013
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://YourDomainName.com/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><PostDeviceMessage><apiKey>c7e91427-0bbc-47a0-be99-14f4a1d161f1</apiKey><xmlMessage>&lt;LocationMessage&gt;
&lt;DeviceId&gt;80c96863-1e37-4&lt;/DeviceId&gt;
&lt;UtcDateTime&gt;2011-08-12 05:50:17 UTC&lt;/UtcDateTime&gt;
&lt;Longitude&gt;31.75497188353929&lt;/Longitude&gt;
&lt;Latitude&gt;-106.4933316389852&lt;/Latitude&gt;
&lt;GpsAccuracyInMeters&gt;20&lt;/GpsAccuracyInMeters&gt;
&lt;AltitudeInMeters&gt;0&lt;/AltitudeInMeters&gt;
&lt;SpeedInKph&gt;10&lt;/SpeedInKph&gt;
View duplicatecolumn.rb
class Listing
include DataMapper::Resource
property :id, Serial
property :customer_id, Integer
belongs_to :customer
# The intent is to have an alias for customer_id.
property :publisher_id, Integer, field: 'customer_id'
View gist:1345897
first = Date.new(year, month, 1)
last = Date.new(year, month, -1)
View gist:1317532
LAWN_CARE_SIC = "0782"
def get_sic_code(sic)
SicCode.first(sic_code:sic)
end
def fix_lawn_care_sic
sic_code = get_sic_code(LAWN_CARE_SIC)
sic_code.category = GCS::Category.first_by_title('lawn-and-garden')
sic_code.sub_category = GCS::SubCategory.first_by_title('lawn-care')
View gist:1317395
'Edward Tootle Lawn Care' 'Entertainment/Movie Distribution' '78202' ["Entertainment"]/["Movie Distribution"]
'Propertymax' 'Entertainment/Movie Distribution' '78202' ["Entertainment"]/["Movie Distribution"]
'NDC Landscape Contracting' 'Entertainment/Movie Distribution' '78204' ["Entertainment"]/["Movie Distribution"]
'Vincent Landscapes' 'House and Home/Movie Distribution' '78204' ["Entertainment"]/["Movie Distribution"]
'Marty Murie's Nativescapes' 'House and Home/Movie Distribution' '78204' ["Entertainment"]/["Movie Distribution"]
'Austin Lawn & Garden' 'House and Home/Movie Distribution' '78206' ["Entertainment"]/["Movie Distribution"]
'Wee Care Landscapes Inc' 'House and Home/Movie Distribution' '78204' ["Entertainment"]/["Movie Distribution"]
'Skippers Stanley S&J Lawn Car' 'Entertainment/Movie Distribution' '78202' ["Entertainment"]/["Movie Distribution"]
'Jacques Landscaping' 'Entertainment/Movie Distribution' '78204' ["Entertainment"]/["Movie Distribution"]
'Woodland Nursery Ctr' 'Entertainment/Movie
View gist:1313777
Lawn 416
Landscape 341
Landscaping 286
Svc 224
Care 178
Maintenance 60
Gardening 53
Tree 52
Service 45
Garden 37
View gist:1313765
COMMON_WORDS = []
desc 'Move buisnesses to one sub category to another'
task :move_businesses, [:from, :to, :heuristic_file] => :environment do |t, args|
puts args
if valid_arguments?(args)
read_heuristic_file(args[:heuristic_file])
move_businesses(args[:from], args[:to])
else
print_usage
View gist:1017397
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <ctype.h>
#define N_UNIT_TESTS 1
#define MAX_YAML_LEN 1024
#define INDENT 4
@flsafe
flsafe / gist:752446
Created Dec 23, 2010
Output of `bundle list`
View gist:752446
Gems included by the bundle:
* ZenTest (4.4.2)
* actionmailer (2.3.5)
* actionpack (2.3.5)
* activerecord (2.3.5)
* activeresource (2.3.5)
* activesupport (2.3.5)
* acts-as-taggable-on (2.0.6)
* authlogic (2.1.6)
* builder (3.0.0)
You can’t perform that action at this time.