#Advent Calendar 2009
##matome iNNX blog
Perl Advent Calendars 2009 - use GFx::WebLog;
##Perl Perl Advent Calendar 2009 english
| For each Ruby module/class, we have Ruby methods on the left and the equivalent | |
| Clojure functions and/or relevant notes are on the right. | |
| For clojure functions, symbols indicate existing method definitions, in the | |
| clojure namespace if none is explicitly given. clojure.contrib.*/* functions can | |
| be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master, | |
| ruby-to-clojure.*/* functions can be obtained from the source files in this | |
| gist. | |
| If no method symbol is given, we use the following notation: |
| # Create new remote branch | |
| git push origin origin:refs/heads/new_branch_name | |
| # Make sure everything is updated | |
| git fetch origin | |
| # Check your branch has been created | |
| git branch -r | |
| # Track a remote branch |
| (ns irclog | |
| (:use net.cgrand.moustache) | |
| (:use net.cgrand.enlive-html) | |
| (:require [ring.httpcore :as hc]) | |
| (:import (org.jibble.pircbot PircBot) | |
| (org.joda.time DateTime) | |
| (org.joda.time.format ISODateTimeFormat))) | |
| (defn yyyy-MM-dd [d] (-> (ISODateTimeFormat/date) (.print d))) |
| (ns compojure.openid | |
| "Compojure OpenID wrapper around jopenid library." | |
| (:use compojure.control) | |
| (:use compojure.encodings) | |
| (:use compojure.http) | |
| (:use compojure.http.session) | |
| (:import com.javaeedev.openid.OpenIdManager) | |
| (:import javax.servlet.http.HttpServletRequest)) | |
| (defn- make-manager |
| Warden::Manager.serialize_into_session{|user| user.id } | |
| Warden::Manager.serialize_from_session{|id| User.get(id) } | |
| Warden::Manager.before_failure do |env,opts| | |
| # Sinatra is very sensitive to the request method | |
| # since authentication could fail on any type of method, we need | |
| # to set it for the failure app so it is routed to the correct block | |
| env['REQUEST_METHOD'] = "POST" | |
| end | |
| For each Ruby module/class, we have Ruby methods on the left and the equivalent | |
| Clojure functions and/or relevant notes are on the right. | |
| For clojure functions, symbols indicate existing method definitions, in the | |
| clojure namespace if none is explicitly given. clojure.contrib.*/* functions can | |
| be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master, | |
| ruby-to-clojure.*/* functions can be obtained from the source files in this | |
| gist. | |
| If no method symbol is given, we use the following notation: |
#Advent Calendar 2009
##matome iNNX blog
Perl Advent Calendars 2009 - use GFx::WebLog;
##Perl Perl Advent Calendar 2009 english
| package Url; | |
| use Modern::Perl; | |
| use Devel::Declare (); | |
| use LWP::Simple (); | |
| use base 'Devel::Declare::Context::Simple'; | |
| sub import { | |
| my $class = shift; | |
| my $caller = caller; | |
| my $ctx = __PACKAGE__->new; |
| (ns swinger | |
| (:import (java.awt BorderLayout Container Dimension)) | |
| (:import (javax.swing JButton JFrame JLabel JPanel JTextField JOptionPane JScrollPane JList ImageIcon JComboBox JSeparator JTable UIManager SwingUtilities AbstractButton JFileChooser JDialog JProgressBar JTabbedPane)) | |
| (:import (javax.swing.table AbstractTableModel)) | |
| (:import (java.awt.event MouseAdapter MouseListener KeyEvent)) | |
| (:import (java.awt Toolkit BorderLayout Dimension Color Dialog$ModalityType)) | |
| (:use (clojure.contrib | |
| [miglayout :only (miglayout components)] | |
| [swing-utils :only (add-action-listener add-key-typed-listener make-menubar)]))) |
| #!/usr/bin/env perl6 | |
| # see: | |
| # * http://transfixedbutnotdead.com/2010/01/13/anyone_for_metaprogramming/ | |
| # * http://transfixedbutnotdead.com/2010/01/14/anyone-for-perl-6-metaprogramming/ | |
| # * http://fingernailsinoatmeal.com/post/292301859/metaprogramming-ruby-vs-javascript | |
| # * http://transfixedbutnotdead.com/2010/10/31/perl6-metaprogramming-update/ | |
| # below runs on Rakudo Star (2010.10 release). |