Skip to content

Instantly share code, notes, and snippets.

-module(action_api).
-include_lib("nitrogen/include/wf.inc").
-include("elements.hrl").
-compile(export_all).
render_action(TriggerPath, TargetPath, Record) ->
DropBoxId = wf:temp_id()
, wf:insert_bottom(body, #hidden{id=DropBoxId, text=""})
, io:format("~p~n", [get(wf_update_queue)])
while getopts "s:r:f:" Option;
do
case $Option in
s)
search=$OPTARG
;;
r)
replace=$OPTARG
;;
f)
sub get_current_word {
return VIM::Eval('expand("<cword>")');
}
sub get_current_line {
my ($row, $col) = $curwin->Cursor();
return $curbuf->Get($row);
}
## script to use the hubble json api to download images to your harddrive.
## modify to suit.
use JSON;
use IO::Pipe;
use IO::File;
my $hubble_data;
my $pipe = IO::Pipe->new();
; Copyright (c) Jeremy Wall. All rights reserved.
; This software is available under the terms of the
; Artistic License 2.0
; (http://www.opensource.org/licenses/artistic-license-2.0.php)
; By using this software in any fashion you are agreeing to be bound by
; the terms of this license.
; You must not remove this notice, or any other, from this software.
(ns
#^{:doc "TAP - Test Anything Protocol Testing framework",
:author "Jeremy Wall",
" genera editing options
set nocompatible
set tabstop=4
set expandtab
set paste
set nowrap
set autoindent
syntax on
filetype plugin indent on
#!/usr/bin/perl -w
use Mac::Growl qw{:all};
use Getopt::Long;
=pod
Put this script in a your $PATH and set it to be executable.
=cut
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Layout
import XMonad.Layout.Column
import XMonad.Layout.LayoutBuilder
import XMonad.Config.Desktop
import XMonad.Util.EZConfig
import XMonad.Util.Run(spawnPipe)
(defn distinctp
"Returns a lazy sequence of the elements of coll with duplicates removed"
[pred coll]
(let [step (fn step [xs seen]
(lazy-seq
((fn [[f :as xs] seen]
(when-let [s (seq xs)]
(if (contains? seen (pred f))
(recur (rest s) seen)
(cons f (step (rest s) (conj seen (pred f)))))))
; minihttpd, tiny barebones clojure web server
; http://alan.xen.prgmr.com/
(ns alandipert.minihttpd
(:use [clojure.contrib.duck-streams :only (reader writer read-lines spit to-byte-array)]
[clojure.contrib.str-utils :only (re-split str-join re-gsub)])
(:import (java.net ServerSocket URLDecoder)
(java.io File)))
(def codes {200 "HTTP/1.0 200 OK"