Skip to content

Instantly share code, notes, and snippets.

View workmaster2n's full-sized avatar

Tyler DeWitt workmaster2n

  • Peritus Resource Group
  • Tulsa, OK
View GitHub Profile
SELECT DISTINCT("tracked_points"."decisecond_recorded_at")
FROM "tracked_points" WHERE
"tracked_points"."decisecond_recorded_at" >= 1393987371
ORDER BY decisecond_recorded_at
SELECT DISTINCT("tracked_points"."decisecond_recorded_at")
FROM "tracked_points" WHERE
"tracked_points"."recorded_at" >= '2014-03-05 06:00:00.000000'
task :rvm_app_alias, roles: :app do
run "rvm alias create #{application} #{rvm_ruby_string_evaluated}"
#run "rvm wrapper #{application} --no-links --all"
end
after "deploy:finalize_update", "deploy:rvm_app_alias"
@Arc.module "Entities", (Entities, App, Backbone, Marionette, $, _) ->
class Entities.Map extends Entities.Model
initialize: ()->
this.on "change", ()->
alert "I changed myself"
$.getJSON "locations/2/geometries.json", (data) ->
this.zones = data
#App.vent.trigger("map:show", this)
#App.MapApp.Show.Controller.showMap(this)
@Arc.module "Entities", (Entities, App, Backbone, Marionette, $, _) ->
class Entities.Map extends Entities.Model
initialize: ()->
$.getJSON "locations/2/geometries.json", (data) ->
this.zones = data
App.MapApp.Show.Controller.showMap(this)
@workmaster2n
workmaster2n / spec.rb
Created February 10, 2014 14:38
Mock Spec
class CategoryCacheClearer < Struct.new(:article)
def call
article.category_list = ''
article.save
end
end
describe CategoryCacheClearer do
describe '#call' do
let(:article) { mock(:save, :category_list=) }
class TweetToTheWorld < Struct.new(:person)
extend Forwardable
#def delegators :person, :twitter_handle, :name
delegate :twitter_hande, to: :person
delegate :name, to: :person
def call
Tweetirific.tweet(handle, twitter_message)
end
desc "all in one"
task :all_in_one => :environment do
#q here is a message q. Assume it receives messages at the rate of 10/second
q.subscribe(:block => true) do |delivery_info, properties, body|
#process the message (body)
puts "I got a message: #{body}"
#I'd like every 10 seconds to output Total Messages Received: 13021
end
@workmaster2n
workmaster2n / fail.console
Created January 15, 2014 19:41
Cacheing has_many through:
p = Person.create
p.items << Item.create
Rails.cache.write(Time.now, p)
=> false
p.reload
Rails.cache.write(Time.now, p)
=> <truthy>
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using QTrack.QT500.Demo.Core;
using QTrack.RemoteEvents;