Skip to content

Instantly share code, notes, and snippets.

SLOC Directory SLOC-by-Language (Sorted)
289 top_dir python=289
182 xml_interfaces python=182
60 test_harnesses python=60
25 unit_tests python=25
Totals grouped by language (dominant language first):
python: 556 (100.00%)
@shargoj
shargoj / gist:5694478
Created June 2, 2013 18:51
Found this on a forum. Homespring is hot.
Universe of fish swimming home in spring to their home spring. They swam up and down and down and up and reverse. down reverse. down reverse. up
time bird fear range. switch young. sense suddenly they scattered and hid fearful in the deepness of the river. The time-bird had sensed the young fish toying around and stroke out from the sky.
They swam down to the bottom of the river trying to avoid all rapids movements. Swimming forward just above the ground they continued their journey to their spring.
But soon the attack was forgotten and the fish swim up again. Now they swam again at surface of the river, swimming up and down and up and down and up, jumping out of the water, falling back and jumping out again.
Joyfully they admired the powers of the sun that is shining on the water and their scales, and warming all their little bodies.
But then, so sadly, it happens, just when they swim again reverse. down FizzBuzz.
insulated rapids fear range. switch bear powers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;; Important Keybindings ;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; When on a mac, ensure sane defaults
(setq mac-option-key-is-meta nil)
(setq mac-command-key-is-meta t)
(setq mac-command-modifier 'meta)
(setq mac-option-modifier nil)
(require 'frame-fns)
(require 'frame-cmds)
(defun jim/set-font-height ()
"sets the font height to the given number"
(interactive)
(let ((font-height (string-to-int (read-from-minibuffer "What height do you want? "))))
(set-face-attribute 'default nil :height font-height)
(maximize-frame)))
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLFW/glfw3.h>
#include <stdexcept>
#include "renderer.h"
#include "game_state.h"
#include "pos.h"
extern GLFWwindow *window;
entities->remove_if([] (const Entity& e) {
return e.has_component("TTL")
&& dynamic_cast<const TTLComponent*>(e.get_component("TTL"))->is_dead();
});
(defun jim/setup-pintos ()
(interactive)
(set-variable
'ede-project-directories
(quote
("/Users/jim/classes/systems/pint-heads/src/lib/user"
"/Users/jim/classes/systems/pint-heads/src/lib/kernel"
"/Users/jim/classes/systems/pint-heads/src/lib"
"/Users/jim/classes/systems/pint-heads/src/threads"
"/Users/jim/classes/systems/pint-heads/src/userprog"
(import '[clojure.lang Reflector])
(defn static-invoke [class member & args]
(if (zero? (count args))
(try
(Reflector/getStaticField class member)
(catch Exception e
(Reflector/invokeStaticMethod
class member clojure.lang.RT/EMPTY_ARRAY)))
(Reflector/invokeStaticMethod class member (object-array args))))
(deftest rested-removed-data-should-reflect-in-db
(with-test-db simple-schema
(let [scm-a (scm {:val1 "name" :val2 123124})
scm-b (scm {:val1 "name"})]
@(db/transact *conn* [(sp->nested-map-for-transaction (db) scm-a)])
@(db/transact *conn* [(sp->nested-map-for-transaction (db) scm-b)])
(let [eid (ffirst (db/q '[:find ?eid :where [?eid :scm/val1 "name"]] (db)))
entity (db/entity (db) eid)]
(is (nil? (:scm/val1 entity)))))))
(deftest rested-removed-data-should-reflect-in-db
(with-test-db simple-schema
(let [scm-a (scm {:val1 "name" :val2 123124})
scm-b (scm {:val1 "name"})]
@(db/transact *conn* [(sp->nested-map-for-transaction (db) scm-a)])
@(db/transact *conn* [(sp->nested-map-for-transaction (db) scm-b)])
(let [eid (ffirst (db/q '[:find ?eid :where [?eid :scm/val1 "name"]] (db)))
entity (db/entity (db) eid)]
(is (nil? (:scm/val2 entity)))))))