Skip to content

Instantly share code, notes, and snippets.

View zedtux's full-sized avatar

Guillaume Hain zedtux

View GitHub Profile
@zedtux
zedtux / link_with_image.html
Last active August 29, 2015 13:55
Example of HTML code with a link on an image
@zedtux
zedtux / link_with_spans.html
Created January 29, 2014 15:43
Example of HTML code with a link on a bunch of spans
@zedtux
zedtux / incrontab
Created February 8, 2014 16:43
incron configuration
/srv/reprepro/incoming IN_CLOSE_WRITE /usr/local/bin/reprepro_trigger.sh $@/$#
@zedtux
zedtux / reprepro_trigger.sh
Created February 8, 2014 16:48
Script used by incron in order to start reprepro.
#!/bin/bash
IN_PATH=$1
# Only care about source packages
echo "$IN_PATH" | grep -q _source.changes
if [ $? = 1 ]
then
exit 0
fi
@zedtux
zedtux / query_cache.rb
Created February 15, 2014 09:18
Current Rails 2.3.18 cache_sql method of ActiveRecord::ConnectionAdapters::QueryCache
def cache_sql(sql)
result =
if @query_cache.has_key?(sql)
log_info(sql, "CACHE", 0.0)
@query_cache[sql]
else
@query_cache[sql] = yield
end
if Array === result
@zedtux
zedtux / fixed_query_cache.rb
Created February 15, 2014 09:25
The thread safe version of the ActiveRecord::ConnectionAdapters::QueryCache cache_sql method.
def cache_sql(sql)
value_from_cache = @query_cache[sql]
result =
if value_from_cache
log_info(sql, "CACHE", 0.0)
value_from_cache
else
@query_cache[sql] = yield
end
@zedtux
zedtux / docker_search.sh
Last active August 29, 2015 14:01
Docker searching for Ruby images
$ sudo docker search ruby
NAME DESCRIPTION STARS OFFICIAL TRUSTED
promptworks/ruby-2.0.0 6 [OK]
paintedfox/ruby A docker image for with Ruby installed. 5 [OK]
germandz/ruby_base Ubuntu 12.04 with Ruby 2.1 & Bundler 1.5.1 3
zaiste/ruby 3 [OK]
studiomelipone/ruby-2.1.1 Ruby on Rails setup used at Studio Melipon... 2 [OK]
promptworks/ruby-2.1 2 [OK]
dockerfile/ruby
# Brewformulas.org web application Docker image
#
# VERSION 1.0
# ~~~~ Image base ~~~~
FROM litaio/ruby
MAINTAINER zedtux, zedtux@zedroot.org
# ~~~~ OS Maintenance ~~~~
@zedtux
zedtux / gist:fbdaa942a926b028fc20
Created May 25, 2014 10:55
`sudo docker images` for brewformulas.org
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
zedtux/brewformulas.org latest a4ce74b16fdc 2 days ago 905.9 MB
litaio/ruby latest bcb111a79fd2 12 days ago 631.6 MB
litaio/ruby 2.1.2 ca838525fef6 13 days ago 621 MB
brewformulas.org
├── brewformulas.org
│   ├── app
│   ├── bin
│   ├── config
│   ├── db
│   ├── features
│   ├── lib
│   ├── log
│   ├── public