Skip to content

Instantly share code, notes, and snippets.

View theycallmeS's full-sized avatar
🦭

Alexey Efremov theycallmeS

🦭
View GitHub Profile
load 'deploy/assets'
namespace :deploy do
namespace :assets do
desc 'Run the precompile task locally and rsync with shared'
task :precompile, :roles => :web, :except => { :no_release => true } do
%x{bundle exec rake assets:precompile}
%x{rsync --recursive --times --rsh=ssh --compress --human-readable --progress public/assets #{user}@#{host}:#{shared_path}}
%x{bundle exec rake assets:clean}
end
@theycallmeS
theycallmeS / f.php
Last active December 22, 2015 08:09 — forked from anonymous/f.php
For given directory, returns every image without its extension from base domain name, e.g. http://domain.com/f.php?c=imagename returns 'imagename.png'
<?php
   if (!empty($_GET["c"]) && file_exists("images/".$_GET["c"].".png")) {
       header("Cache-control: public");
       header("Content-type: image/png");
       readfile("images/".$_GET["c"].".png");
   } else {
       header("HTTP/1.0 404 Not Found");
   }
?>