Skip to content

Instantly share code, notes, and snippets.

View trevorturk's full-sized avatar

Trevor Turk trevorturk

  • Chicago
View GitHub Profile
@trevorturk
trevorturk / main.rb
Created February 10, 2022 18:31 — forked from amirrajan/main.rb
DragonRuby Game Toolkit - Shadows (https://amirrajan.itch.io/shadows)
class Game
attr_gtk
def tick
defaults
input
calc
render
end
@trevorturk
trevorturk / import_attachment_basecamp.rb
Created June 25, 2012 14:50 — forked from shingara/import_attachment_basecamp.rb
Script to download all attachments from a basecamp project
require 'faraday'
require 'faraday_middleware'
url_project = 'https://ciblonet.basecamphq.com'
project_id = 3684800
user_name = 'shingara'
password = 'xxxx'
class Attachment
@trevorturk
trevorturk / current.rb
Created May 7, 2012 20:27 — forked from scottweisman/current.rb
Using current_kase method in views
# concerns#current
module Current
extend ActiveSupport::Concern
...
def current_kase
@current_kase ||= Kase.find_by_id(params[:kase_id])
end
# To include methods in views
@trevorturk
trevorturk / emoji.txt
Created April 3, 2012 18:47 — 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
From bb2a78858cffa7c6937642986e9aca1a4f862c0d Mon Sep 17 00:00:00 2001
From: Ilya Grigorik <[email protected]>
Date: Thu, 10 Jun 2010 00:46:48 -0400
Subject: [PATCH] async rails3
---
Gemfile | 6 ++++++
app/controllers/widgets_controller.rb | 6 ++++++
app/models/widget.rb | 2 ++
config.ru | 1 +
require 'test_helper'
class UsersTest < ActionController::IntegrationTest
setup do
reset!
@conn = Faraday::Connection.new do |b|
b.adapter :action_dispatch, @integration_session
b.response :rails_json
end
end
STDOUT.sync = true
require 'queue'
start_time = Time.now.to_i
msg = 0
queue = Queue.new("testing")
queue.subscribe do |obj|
msg += 1
#!/usr/bin/env ruby
## WP2TUMBLR: WordPress 2 Tumblr Importing tool
##
## Usage: wp2tumblr [OPTION] WORDPRESS_XML_FILE
##
## Import the WORDPRESS_XML_FILE to a Tumblr blog.
## Provide `--group` option to publish to a group.
## This could take a long time...
##
## To install, download the script and chmod to 755.
# Export your Wordpress posts to Tumblr (also allows to delete some.)
# Author: Alexandre Solleiro <[email protected]>
# How-to:
# 1. Export your Wordpress posts (http://en.blog.wordpress.com/2006/06/12/xml-import-export/)
# 2. Edit the information below to match your settings
# 3. To import, type "ruby wordpress2tumblr.rb --run" in the command line
# 4. To delete some posts, type "ruby wordpress2tumblr.rb --delete 1,2,3,4" where 1,2,3,4 are post numbers. (Be careful not to use spaces between IDs)
# Edit these
WP_EXPORT_PATH = "./wordpress.2009-09-14.xml" # path to the Wordpress Export file
require 'disqus'
require 'disqus/api'
require 'disqus/author'
require 'disqus/forum'
require 'disqus/post'
require 'disqus/thread'
require 'disqus/version'
desc "Load Blog comments to Disqus"
task :load_disqus => :environment do