Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Vest chrisvest

View GitHub Profile
View GraphGist-SimpleRBAC.adoc

This is a very simple approach to doing role-based access control with Neo4j. It is optimistic, in the sense that all items are assumed to be world-accessible unless they have specific constraints. Item visibility can be constrained to either individual users or all users who belong to a role. Roles are also hierarchical, so can inherit privileges from other roles.

First, lets create our basic example data:

View _service.md

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@chrisvest
chrisvest / Notes.md
Created Jun 14, 2012 — forked from rednaxelafx/JDK5u22_client.log
PrintCompilation on different versions of HotSpot VM
View Notes.md

About PrintCompilation

This note tries to document the output of PrintCompilation flag in HotSpot VM. It was originally intended to be a reply to a blog post on PrintCompilation from Stephen Colebourne. It's kind of grown too big to fit as a reply, so I'm putting it here.

Written by: Kris Mok rednaxelafx@gmail.com

Most of the contents in this note are based on my reading of HotSpot source code from OpenJDK and experimenting with the VM flags; otheres come from HotSpot mailing lists and other reading materials listed in the "References" section.

Creative Commons License
This <span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Text" rel="dct:type

View chrisvest-4clojure-solution145.clj
;; chrisvest's solution to For the win
;; https://4clojure.com/problem/145
(range 1 38 4)
View chrisvest-4clojure-solution134.clj
;; chrisvest's solution to A nil key
;; https://4clojure.com/problem/134
#(nil? (%1 %2 1))
@chrisvest
chrisvest / stupid.js
Created Dec 14, 2011 — forked from igstan/stupid.js
Stupid way to write a negate if statement without the logical negation operator
View stupid.js
var b = false;
if (b^b&b|b) {} else {
println("false branch");
}
View chrisvest-4clojure-solution90.clj
;; chrisvest's solution to Cartesian Product
;; https://4clojure.com/problem/90
#(set (for [a %1 b %2] [a b]))
View chrisvest-4clojure-solution83.clj
;; chrisvest's solution to http://4clojure.com/problem/83
#(= (set %&) #{true false})
View chrisvest-4clojure-solution81.clj
;; chrisvest's solution to http://4clojure.com/problem/81
#(set (filter %1 %2))
View chrisvest-4clojure-solution80.clj
;; chrisvest's solution to http://4clojure.com/problem/80
#(let [ntz (Integer/numberOfTrailingZeros %1)]
(= (bit-shift-right %1 ntz) (dec (bit-shift-left 1 (inc ntz)))))
You can’t perform that action at this time.