Skip to content

Instantly share code, notes, and snippets.

View solussd's full-sized avatar

Joe R. Smith solussd

View GitHub Profile
@solussd
solussd / gist:1514590
Created December 23, 2011 16:11
why does this end in a BAD_ACCESS?
@implementation SBAppDelegate {
__weak NSNumber *aNumber;
NSNumber *anotherNumber;
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
NSNumber *myNumber = [NSNumber numberWithInt:2];
self->anotherNumber = myNumber;
self->aNumber = myNumber;
}
@solussd
solussd / gist:1595144
Created January 11, 2012 15:19
why doesn't this print the result of {:tag audit-rootkey :attrs {} :content (map to-xml-struct directory-records)} to stdout?
(defn generate-file-audit-xml
"Takes a seq of DirectoryRecords that contains the file audit and outputs an XML string with a
top level element with the value of file-audit/audit-rootkey"
[directory-records]
{:pre [(sequential? directory-records)]}
(let [out *out*]
(-> (binding [*out* out] {:tag audit-rootkey :attrs {} :content (map to-xml-struct directory-records)})
xml/emit
with-out-str)))
(defn render-page [renderer [_ path] transmitter]
(let [parent (render/get-parent-id renderer path)
id (render/new-id! renderer path)
html (templates/add-template renderer path (:pedestal-sandbox-page templates))]
(dom/append! (dom/by-id parent) (html {:id id :message "" :blah "val"}))))
# Setting GIT prompt
c_cyan=`tput setaf 6`
c_red=`tput setaf 1`
c_green=`tput setaf 2`
c_sgr0=`tput sgr0`
branch_color ()
{
if git rev-parse --git-dir >/dev/null 2>&1
then
@solussd
solussd / deps+nrepl.md
Last active February 23, 2022 05:43
nrepl + deps.edn quickstart

Instructions

  1. Add nrepl server dep to deps.edn :dev alias extra deps
org.clojure/tools.nrepl {:mvn/version "0.2.12"}
  1. create dev/user.clj containing the following:
(ns user
 (:require [clojure.tools.nrepl.server :as nrepl]))