This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
pattern = /-\d+x\d+\.(jpg|png|jpeg)/ # my-file-name-pattern-2000x2000.jpg | |
files = Dir.glob("/path/to/wordpress/wp-content/uploads/20XX/**/*.*") | |
files.sort! | |
files.each do |file| | |
if pattern =~ file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
mariadb: | |
image: 'docker.io/bitnami/mariadb:10.3-debian-10' | |
volumes: | |
- 'mariadb_data:/bitnami/mariadb' | |
- ./db-dump.sql:/docker-entrypoint-initdb.d/init.sql | |
environment: | |
- MARIADB_USER=bn_wordpress | |
- MARIADB_DATABASE=bitnami_wordpress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$fn=64; | |
module added(){ | |
hull(){ | |
cube([235,60,6]); | |
translate([0,0,6]) cube([160,60,18]); | |
} | |
} | |
module taken(lb){ | |
hull(){ | |
translate([(160/2)+13,0,3]) cylinder(r=9, h=20); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@reboot cd /var/www/apps/myapp/current && bundle exec unicorn -c /var/www/apps/myapp/current/config/unicorn.rb -E production -D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#app/models/event.rb | |
class Event < ActiveRecord::Base | |
translates :title, :description | |
has_many :event_translations | |
accepts_nested_attributes_for :event_translations, :allow_destroy => true | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Controller | |
include LazyLoad | |
def show | |
@model = Model.find(...) | |
respond_to do |format| | |
format.html do | |
@html_specific_data = Model.find(...) | |
end |