Skip to content

Instantly share code, notes, and snippets.

@daxadax
daxadax / gist:f138331cdcbdda587a6fe19abe50dadf
Last active October 25, 2022 22:36
DCL DAO x GSS: About Dax
Hi everyone,
I'm Dax, you've probably seen me in the discord or forum!
The Grant Support Squad asked me to write up an introduction about myself after asking me to join the <XXXX>, so I hope this
will give you an idea about me and what I'm hoping to help with in the coming months.
Professional Background
I'm currently a backend developer at a startup and working on side projects such as DCL-metrics, a DAO funded analytics

RIFT ARENA

Submission for the DCL 2022 Game Jam, inspired by the game Rift Wizard

Assets

Most of the assets were created by Vex or myself. Some assets are from the decentraland builder asset packs.

The following are opensource assets from outside decentraland:

require 'gmail'
require 'csv'
require 'io/console'
class EmailExtractor
def self.run
new.run
end
def initialize
@daxadax
daxadax / factory_girl_hack.rb
Last active May 25, 2016 15:10
override callbacks after creating models with factory girl
FactoryGirl.define do
factory :my_factory do
cost_per_driving_hour 10
cost_per_cultivation_hour 50
after(:create) do |instance, evaluator|
instance.cost_per_driving_hour = evaluator.cost_per_driving_hour
instance.cost_per_cultivation_hour = evaluator.cost_per_cultivation_hour
instance.save
class DumpObjects
attr_reader :objects, :output
def initialize(objects, output_path)
@objects = objects
@output = output_path
end
def run
File.open(output_path, "w") do |file|
disclaimer: the URL used is just an example. I've picked the first from /r/opendirectories that worked good enough
Not sure if this post is ok, but I figured I'd share some tips for mass-downloading things from directories.
I've used this for dirs with lots and lots of say, mp3 files. It's easily customized, and better yet, fast!
If the server in question uses apache (which thankfully most do), retrieving a textual representation of the URLs that is stored in a local file is usually the first step one should do. That way the index doesn't have to be re-downloaded all the time, thus hugely improving speed.
I found lynx does the best job at this, because lynx comes with a feature that transforms the HTML tree into a textual representation:
lynx -dump http://ls.df.vc/pictures/ > listing.txt
results in this (for example):
Index of /pictures/
Name Last Modified Size Type
describe 'database performance' do
before { @sql_calls = 0 }
after { ActiveSupport::Notifications.unsubscribe(@subscription) }
it 'makes a minimum of db queries' do
@subscription = ActiveSupport::Notifications.subscribe('sql.active_record') do |event|
@sql_calls += 1
end
get :index, attributes.merge(format: :json)
@daxadax
daxadax / gist:52b0168de417ab7e2ed7
Last active August 29, 2015 14:19
conference talks
sandi metz: nothing is something http://confreaks.tv/videos/bathruby2015-nothing-is-something
@daxadax
daxadax / burgerbot.rb
Last active April 13, 2022 09:20
burgerbot
#!/usr/bin/env ruby
# modified from https://gist.github.com/pbock/3ab260f3862c350e6b5f #
require 'watir-webdriver'
class BurgerBot
def initialize
@attempt_count = 0