anonyfox and many others are using Hackety Hack to learn how to code.

Hackety Hack is a free program for Windows, Mac OS X and Linux that can teach you how to make games, applications and more and share those programs with your friends. You can ask other budding programmers questions and follow them to see what code they're working on through the Hackety Hack website.

Sign up Learn More

picsorter by anonyfox

#encoding: utf-8

$from = "/home/fox/Downloads" #the place all the downloadstuff lies
$to= "/home/fox/Bilder/Collection" #the root of the category-subdir's
$app_path = "/home/fox/.hacketyhack" #just for info

require "fileutils" 
require "./PicSorterHelper.rb"
include PicSorterHelper

Shoes.app :width => 1000, :height => 600, :title =>"PicSorter" do 
  begin
    @pics = get_files || []
    @folders = get_subdirs || []
    flow :width => 900 do
      stack :width => 700, :height => 500, :scroll=>true do
        @i = image
        @i.path = $from+"/"+@pics[0]
        @i.width = 700 if @i.full_width > 700
        #@i.width -= 10 if @i.height > 500 && @i.width > 690
        @p = para @pics[0]
      end #stack      
      
      @folder_list = stack :width => 200
      draw_buttons(@folders)
    end #flow
  rescue => e
    alert e.message
  end
end