Skip to content

Instantly share code, notes, and snippets.

from macropy.macros.string_interp import macros, s
a, b = 1, 2
c = s%"%{a} apple and %{b} bananas"
@ducky427
ducky427 / viz.js
Last active September 16, 2023 08:15
d3.csv("data/gates_money.csv", function(data) {
custom_bubble_chart.init(data);
custom_bubble_chart.toggle_view('all');
});
$(document).ready(function() {
$('#view_selection a').click(function() {
var view_type = $(this).attr('id');
$('#view_selection a').removeClass('active');
$(this).toggleClass('active');

Keybase proof

I hereby claim:

  • I am ducky427 on github.
  • I am rohit (https://keybase.io/rohit) on keybase.
  • I have a public key ASCGRWg4tLLWMcKtvJs4JSaz7rzYoThes3Rzbyc_WqqTmQo

To claim this, I am signing this object:

@ducky427
ducky427 / core.clj
Last active August 29, 2015 14:04
Bulk create test using neocons
(ns bulk-test.core
(:require [clojurewerkz.neocons.rest :as nr]
[clojurewerkz.neocons.rest.nodes :as nn]
[clojurewerkz.neocons.rest.cypher :as cy])
(:gen-class))
(defn create-nodes
[conn num]
(let [nodes (repeat num {:name "Joe Bloggs" :age 32})]
(nn/create-batch conn nodes)))
@ducky427
ducky427 / gist:9125b39d797738865c21
Created August 12, 2014 14:37
Length of linked list
try(Transaction tx = db.beginTx()) {
Node startNode = db.getNodeById( nodeId );
int maxLength = 0;
boolean to_continue = true;
while (to_continue) {
maxLength++;
Iterator<Relationship> rels = startNode.getRelationships(Direction.OUTGOING, NEXT).iterator();
if (rels.hasNext()) {
startNode = rels.next().getEndNode();
;; Copyright (c) 2011-2014 Michael S. Klishin, Alex Petrov, and The ClojureWerkz
;; Team
;;
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;; the terms of this license.
;; You must not remove this notice, or any other, from this software.
(ns neocons-timeout.core
(:require [clojurewerkz.neocons.rest :as nr]
[clojurewerkz.neocons.rest.nodes :as nn]))
(defn -main
[& args]
(let [conn (-> (nr/connect "http://localhost:7474/db/data/")
(assoc-in [:options :socket-timeout] 1000) ;;timeout in milliseconds
(assoc-in [:options :conn-timeout] 1000))]
(println (nr/create conn {:name "John"}))))
@ducky427
ducky427 / core.cljs
Created June 11, 2015 11:31
Facebook's fixed data for reagent. Adapted from https://github.com/ul/fixed-data-table-demo
(ns datatable.core
(:require [reagent.core :as reagent]
[cljsjs.fixed-data-table]))
(def Table (reagent/adapt-react-class js/FixedDataTable.Table))
(def Column (reagent/adapt-react-class js/FixedDataTable.Column))
(defn gen-table
"Generate `size` rows vector of 4 columns vectors to mock up the table."
[size]
@ducky427
ducky427 / # llvm - 2018-12-28_11-11-55.txt
Created December 28, 2018 11:14
llvm on macOS 10.14.2 - Homebrew build logs
Homebrew build logs for llvm on macOS 10.14.2
Build date: 2018-12-28 11:11:55