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
(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)]))) |
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
# the following two lines give a two-line status, with the current window highlighted | |
hardstatus alwayslastline | |
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]' | |
# huge scrollback buffer | |
defscrollback 5000 | |
# no welcome message | |
startup_message off |
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 main() { | |
println!("hello world!"); | |
let foo = format!("hello rustacean!"); | |
println!("{}", foo); | |
let x = 5 + 10; | |
println!("x is {}", x); | |
#[allow(unused_variables)] | |
let y: i32 = 42; |
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
(* random code samples *) | |
Char.code 'a' (* => 97 *) | |
Char.uppercase 'a' | |
Char.chr 33 (* => ! *) | |
(* STRING CONCATENATION *) |
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
Ironfan.cluster 'test0' do | |
cloud(:ec2) do | |
availability_zones ['us-east-1d'] | |
ssh_user "ubuntu" | |
permanent false | |
flavor 'm1.large' | |
backing 'ebs' | |
image_name 'natty' | |
bootstrap_distro 'ubuntu12.04-ironfan' |
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
Ironfan.cluster 'test0' do | |
cloud(:ec2) do | |
permanent false | |
availability_zones ['us-east-1d'] | |
flavor 't1.micro' | |
backing 'ebs' | |
image_name 'natty' | |
bootstrap_distro 'ubuntu10.04-ironfan' | |
chef_client_script 'client.rb' | |
mount_ephemerals |
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
Ironfan.cluster 'test0' do | |
cloud(:ec2) do | |
permanent false | |
availability_zones ['us-east-1d'] | |
flavor 't1.micro' | |
backing 'ebs' | |
image_name 'natty' | |
bootstrap_distro 'ubuntu10.04-ironfan' | |
chef_client_script 'client.rb' | |
mount_ephemerals |
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/hbase org.jruby.Main | |
# | |
# HBase status plugin | |
# === | |
# | |
# This plugin checks if any of the regionservers are down | |
# | |
# Copyright 2012 Runa Inc | |
# | |
# Released under the same terms as Sensu (the MIT license); see LICENSE |
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
(def x (ref 0) | |
(def agents (for [i (range 0 1000)] (agent x))) | |
(map #(send %1 (fn [x] (dosync (alter x inc)))) agents) |
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
is_table_defn_updated() -> | |
mnesia:table_info(version1, attributes) =/= record_info(fields, version1). | |
upgrade_version_table() -> | |
case is_table_defn_updated() of | |
false -> ok; | |
true -> | |
NewAttrs = record_info(fields, version1), | |
{ atomic, ok } = mnesia:transform_table(version1, (fun transformer/1), NewAttrs) | |
end. |
NewerOlder