Skip to content

Instantly share code, notes, and snippets.

@atomgiant
atomgiant / gist:5438672
Last active December 16, 2015 12:59
How To Test Rails Asset pipeline in development
# NOTE: To test asset pipeline in development set the following config.assets.* below in
# your config/environments/development.rb and then run:
#
# $ RAILS_ENV=development rake assets:precompile
#
# It is recommended you rm -rf public/assets and turn off these settings in development when
# you are finished or this may cause issues with assets in your local development environment
#
# config.assets.compress = true
# config.assets.compile = false
@atomgiant
atomgiant / url_loader.rb
Created March 17, 2013 13:14
Curl url downloader as an alternative to curb
# Helper class to save urls to a file
class UrlLoader
# Download a url and optionally specify a path to save it to a file.
def self.get(url, path=nil)
# set curl to timeout after 30 minutes for any calls
cmd = "curl --fail --location --silent --show-error --max-redirs 10 --connect-timeout 60 --max-time 1800"
cmd += " --output #{path}" unless path.nil?
cmd += " '#{url}'"
rsp = `#{cmd}`
raise "Received non-success response code for url: '#{url}'" if (path.nil? ? rsp.empty? : (!File.exists?(path) || File.size(path) == 0))
@atomgiant
atomgiant / bootstrap.lua
Last active March 20, 2021 01:47
MineCraft Lua scripts
h=fs.open("/gfs","w");h.write(http.get("https://gist.github.com/ntalbott/4719172/raw/gfs.lua").readAll());h.close();print "Done";