Skip to content

Instantly share code, notes, and snippets.

View flazz's full-sized avatar

Franco Lazzarino flazz

View GitHub Profile
% find /stage/var/daitss/webcache2 -ls | grep -v 'daitss '
3286762 44 -rw-rw-r-- 1 manny manny 37025 Dec 10 17:37 /stage/var/daitss/webcache2/www.loc.gov/standards/mods/v3/mods-3-0.xsd
3286763 8 -rw-rw-r-- 1 manny manny 3180 Dec 10 17:37 /stage/var/daitss/webcache2/www.loc.gov/standards/mods/xlink.xsd
392646 12 -rw-rw-r-- 1 fischer fischer 5840 Nov 21 14:52 /stage/var/daitss/webcache2/www.loc.gov/mods/xml.xsd
d
3222104 8 drwxrwxr-x 3 manny manny 4096 Dec 10 19:06 /stage/var/daitss/webcache2/palmm.fcla.edu
3222106 8 drwxrwxr-x 2 manny manny 4096 Dec 10 19:06 /stage/var/daitss/webcache2/palmm.fcla.edu/strucmeta
3222107 28 -rw-rw-r-- 1 manny manny 23000 Dec 10 19:06 /stage/var/daitss/webcache2/palmm.fcla.edu/strucmeta/MXF.dtd
3221710 8 drwxrwxr-x 2 manny manny 4096 Nov 21 18:16
(defun gist-region-or-buffer (&optional private)
"Post either the current region, or if mark is not set, the current buffer as a new paste at gist.github.com
Copies the URL into the kill ring.
With a prefix argument, makes a private paste."
(interactive "P")
(condition-case nil
(gist-region (point) (mark) private)
(mark-inactive (gist-buffer private))))
function (debug)
{
var db = new CouchDB("test_suite_db");
db.deleteDb();
db.createDb();
if (debug)
;
var binAttDoc = { "_id": "bin_doc", "_attachments": { "foo.txt": { "content_type": "text/plain", "data": "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ=" } } };
T(db.save(binAttDoc).ok);
var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt");
%curl -i -X PUT -H 'Content-Type: image/jpeg' --data-binary - 'http://localhost:5984/test_suite_db//picard?rev=250044251' < ~/Desktop/picard-facepalm.jpg
%curl: (52) Empty reply from server
% log
[error] [<0.5584.0>] {error_report,<0.22.0>,
{<0.5584.0>,crash_report,
[[{pid,<0.5584.0>},
{registered_name,[]},
{error_info,
{error,
% autotest -v
No tests matched .gitignore
No tests matched spec/spec_helper.rb
No tests matched spec/tipr_descriptor_spec.rb
No tests matched templates/tipr.xml.erb
No tests matched coverage/index.html
No tests matched html/created.rid
... # nothing is matched
@flazz
flazz / dummy.el
Created January 30, 2009 21:12
code for manny
(defun dummy () )
(defun q (g n)
(let ((r (lambda () n)))
(if (not (= n 0))
(q r 0)
(g))))
(q 'dummy 1)
<premis>
<event>
<eventIdentifier>
<eventIdentiferType>URI</eventIdentiferType>
<eventIdentiferValue>daitss:$event_id</eventIdentiferValue>
</eventIdentifier>
<eventType>
<!-- spell out daitss:EVENT_TYPE in nice english -->
class String
def wrap(width)
if length > width
self[0...width] + '\n' + self[width..-1].wrap(width)
else
self
end
-- q1
sum [ n | n <- [1..1000-1], n `mod` 3 == 0 || n `mod` 5 == 0 ]
-- q2
let fib = 1 : 1 : zipWith (+) fib (tail fib)
in sum (takeWhile (< 4000000) [ n | n <- fib, n `mod` 2 == 0 ])
-- q3 (not working)
let n = 600851475143
let factors n = [ (n `div` x) | x <- [2..(n `div` 2)], n `mod` (n `div` x) == 0 ]
@flazz
flazz / gist:78125
Created March 12, 2009 15:35 — forked from lydiam/gist:78122
<?xml version="1.0" encoding="ISO-8859-1"?><METS:mets xmlns:METS="http://www.loc.gov/METS/" xmlns:daitss="http://www.fcla.edu/dls/md/daitss/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:mods="http://www.loc.gov/mods/v3" xmlns:palmm="http://www.fcla.edu/dls/md/palmm/" xmlns:rightsmd="http://www.fcla.edu/dls/md/rightsmd/" xmlns:techmd="http://www.fcla.edu/dls/md/techmd/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" LABEL="May 2008 stats" OBJID="DT_DTL01_77643" TYPE="" xsi:schemaLocation="http://www.loc.gov/METS/ http://www.loc.gov/standards/mets/version17/mets.v1-7.xsd http://purl.org/dc/elements/1.1/ http://dublincore.org/schemas/xmls/simpledc20021212.xsd http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-0.xsd http://www.fcla.edu/dls/md/techmd/ http://www.fcla.edu/dls/md/techmd.xsd http://www.fcla.edu/dls/md/palmm/ http://www.fcla.edu/dls/md/palmm.xsd http://www.fcla.edu/dls/md/rightsmd/ htt