I hereby claim:
- I am sixty4bit on github.
- I am sixty4bit (https://keybase.io/sixty4bit) on keybase.
- I have a public key whose fingerprint is FF61 67DD BE84 A843 36F0 558C 04F8 F0CE DF1F 9DEB
To claim this, I am signing this object:
# 2023-11-27 MIT LICENSE | |
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com. | |
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town. | |
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X https://x.com/levelsio or this Gist so more people can do the same! | |
Send me your ChatGPT text adventure game on X, I'd love to try it! |
require 'shopify_api' | |
API_KEY = 'enteryourkeyhere' | |
PASSWORD = 'enteryourpasswordhere' | |
SHOP_NAME = 'yourshopname' | |
shop_url = "https://#{API_KEY}:#{PASSWORD}@#{SHOP_NAME}.myshopify.com/admin" | |
ShopifyAPI::Base.site = shop_url | |
i = 11211316 # start with ab1234 | |
product_count = ShopifyAPI::Product.count |
batches = Queue.new | |
Order.select(:id).find_in_batches do |batch| | |
batches << batch.map(&:id) | |
end | |
cpu_available.times do | |
Thread.new do | |
while(ids = batches.pop) | |
pid = Process.fork do | |
Sunspot.index! Order.includes(:product).find(ids) | |
end |
cpu_available = 5 | |
Order.includes(:products).find_in_batches do |batch| | |
batch.in_groups(cpu_available, false) do |group| | |
Process.fork do | |
Sunspot.index! group | |
end | |
end | |
Process.waitall | |
end |
{ active: 'activate!', inactive: 'deactivate!', blocked: 'block!', suggested: 'suggest!' }.each do |state_name, trigger_name| | |
define_singleton_method(state_name) { where(state: state_name.to_s) } | |
define_method(trigger_name.to_sym) { update_attribute(state: state_name.to_s) } | |
end | |
I hereby claim:
To claim this, I am signing this object:
@stream = Twitter::Streaming::Client.new do |config| | |
config.consumer_key = ENV['TWITTER_CONSUMER_KEY'] | |
config.consumer_secret = ENV['TWITTER_CONSUMER_SECRET'] | |
config.access_token = ENV['TWITTER_ACCESS_TOKEN'] | |
config.access_token_secret = ENV['TWITTER_ACCESS_TOKEN_SECRET'] | |
end | |
keywords = ['sochi', 'olympics'] | |
@stream.filter(:track => keywords.join(",")) do |object| | |
if object.is_a?(Twitter::Tweet) | |
puts "#{object.id} #{object.user.screen_name} - #{object.text}" |
require 'rubygems' | |
gem 'activerecord', '3.0.4' | |
gem 'activerecord-oracle_enhanced-adapter', '1.4.0' | |
require 'active_record' | |
ActiveRecord::Base.establish_connection( :adapter => 'oracle_enhanced', :database => 'orcl', | |
:username => 'hr', :password => 'hr') | |
ActiveRecord::Base.connection.instance_eval do | |
drop_table :jobs rescue nil |
// Make all lines comments first | |
BufferedReader inputFile = new BufferedReader(new FileReader("input.txt")); | |
String line = null; | |
while((line=inputFile.readLine())!=null){ | |
System.out.println("comment found: " + line); | |
} | |
// Now find email addresses | |
BufferedReader inputFile = new BufferedReader(new FileReader("input.txt")); | |
String line = null; |
class Object | |
# call send on nested objects. | |
# example: nested_send(blog_post, 'author.name') #=> 'Bob' | |
# returns nil if any call returns nil | |
def nested_send(method_name) | |
val = self | |
method_names = method_name.split('.') | |
method_names.each do |m| | |
return nil unless val |