Skip to content

Instantly share code, notes, and snippets.

View KirinDave's full-sized avatar

Dave Fayram KirinDave

View GitHub Profile
### Keybase proof
I hereby claim:
* I am kirindave on github.
* I am kirindave (https://keybase.io/kirindave) on keybase.
* I have a public key whose fingerprint is E31F 2C5C 62E1 CB57 3B5B AF97 73DC C83A E5E6 E137
To claim this, I am signing this object:
@KirinDave
KirinDave / assoc-if.clj
Created February 21, 2014 00:32
I just wrote this today for building json structures out of destructured arguments.
(defn assoc-if
"Can someone explain to me how this is not in the stdlib?"
([h key value xformer]
(if-not (nil? value)
(assoc h key (xformer value))
h))
([h key value] (assoc-if h key value identity)))
validate_tables: function() {
// Sometimes you can have as much fun indoors as outdoors.
var self = this;
var found = 0; var needed = this.tables.length; var reported = 0;
var callback = function(present) {
if(present) {
found += 1;
}
reported += 1;
if(reported == needed) {
(define-action (index)
`(html ,(html-header "Account")
(body
(h4 "Note that this action needs to reflect that a user is logged in.")
(a ([href "/account/login"]) "Login") (br)
(a ([href "/account/signup"]) "Signup"))))
(define-action (response formp1 formp2)
(dispatch/c
`(html ,(html-header "Account")
%% ``The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved via the world wide web at http://www.erlang.org/.
%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
<html>
<head>
<title>Test</title>
<style>
.popup {
border: double 3px #000000;
font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
display: none;
position: absolute;
<html>
<head>
<title>Welcome to Oatmeal Homeland!</title>
<meta name="description" content="">
<meta name="keywords" content="Private server, WoW, World of Warcraft">
<STYLE>
:link {color: #666633; font-weight: normal;}
makeSearchCommand({
name: "Powerset",
url: "http://www.powerset.com/explore/go/{QUERY}",
icon: "http://www.powerset.com/favicon.ico",
description: "Searches Powerset for your words.",
preview: function(p, txt) {
p.innerHTML = "Searches powerset for: <i>" + txt.text + "</i>"
}
});
// ==UserScript==
// @name gaia-c-t-userscript
// @namespace http://github.com/linuxfood/gaia-c-t-userscript/
// @description A greasemonkey script adding a whole mess 'o features to GaiaOnline, C&T
// @include http://www.gaiaonline.com/forum/c-t-tech-talk/*
// ==/UserScript==
/* ========================================
Key vars
======================================== */
%% ``The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved via the world wide web at http://www.erlang.org/.
%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.