Skip to content

Instantly share code, notes, and snippets.

View vedang's full-sized avatar
🐢
Slow and steady

Vedang Manerikar vedang

🐢
Slow and steady
View GitHub Profile
@kirankulkarni
kirankulkarni / vagrant_helpers.sh
Last active August 29, 2015 14:06
A set of helper functions to suspend/resume your vagrant boxes from shellscript
#!/bin/bash
function vagrant_get_status()
{
cd "$1"
local status_op=$(vagrant status --machine-readable)
echo "$status_op" | while read line
do
local status_line=(${line//,/ })
local vagrant_type=${status_line[2]}
@antonj
antonj / aj-toggle-fold.el
Created March 17, 2011 10:17
Emacs command to toggle folding of all lines with indentation larger than that on the current line.
(defun aj-toggle-fold ()
"Toggle fold all lines larger than indentation on current line"
(interactive)
(let ((col 1))
(save-excursion
(back-to-indentation)
(setq col (+ 1 (current-column)))
(set-selective-display
(if selective-display nil (or col 1))))))
(global-set-key [(M C i)] 'aj-toggle-fold)
@RichardHightower
RichardHightower / using_cojure_from_java.md
Created April 6, 2016 19:54
Example using Clojure from Java

Normal Java project

tree
.
├── build.gradle
├── gradle
│   └── wrapper
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
@clojens
clojens / re.clj
Created December 12, 2013 17:58
A few clojure java regex samples
(def ptrn
{
:a {:pattern #"a(?!b)"
:purpose "Only allow a if it is not preceded by a 'b' (negative lookahead)"
:samples ["acdefg" ; ok
"abcdef" ; nil
]}
:b {:pattern #"(?i)(<title.*?>)(.+?)(</title>)"
@khinsen
khinsen / org-link-pinboard.el
Created December 2, 2019 08:19
Add org-mode link support to pinboard.el (https://github.com/davep/pinboard.el)
@jackrusher
jackrusher / AAA-README.md
Created October 16, 2020 12:02
Clojure + FUSE

Meld

A minimal example of creating a (mostly) working FUSE filesystem using Clojure. NOTE: I have only tested this with OSX, and it assumes you have already installed libfuse.

Trying it out

Create an empty directory at /tmp/meld to serve as your mount point, put these files in a directory called meld, then:

@levand
levand / data-modeling.md
Last active May 19, 2023 16:38
Advice about data modeling in Clojure

Since it has come up a few times, I thought I’d write up some of the basic ideas around domain modeling in Clojure, and how they relate to keyword names and Specs. Firmly grasping these concepts will help us all write code that is simpler, cleaner, and easier to understand.

Clojure is a data-oriented language: we’re all familiar with maps, vectors, sets, keywords, etc. However, while data is good, not all data is equally good. It’s still possible to write “bad” data in Clojure.

“Good” data is well defined and easy to read; there is never any ambiguity about what a given data structure represents. Messy data has inconsistent structure, and overloaded keys that can mean different things in different contexts. Good data represents domain entities and a logical model; bad data represents whatever was convenient for the programmer at a given moment. Good data stands on its own, and can be reasoned about without any other knowledge of the codebase; bad data is deeply and tightly coupled to specific generating and

@theasp
theasp / pg.cljs
Created December 15, 2017 20:08
Using `pg` from ClojureScript on Node.js with an interface like `postgres.async`
(ns hello-world.pg
(:require
[clojure.string :as string]
[cljs.nodejs :as nodejs]
[cljs.core.async
:refer [<! chan put! close! onto-chan to-chan]]
[taoensso.timbre :as timbre
:refer-macros [tracef debugf infof warnf errorf]])
(:require-macros
[cljs.core.async.macros :as m :refer [go]]))
@dive
dive / fix-emacs-permissions-catalina.el
Created September 29, 2019 09:55
Fix Emacs permissions on macOS Catalina
;;; package --- Fix permissions for Emacs.app on macOS Catalina
;;; Author: Artem Loenko
;;; Mail-To: <artyom.loenko@mac.com>
;;; Commentary:
;;; Code:
(defconst _default-emacs-app-plist-path "/Applications/Emacs.app/Contents/Info.plist")
(defconst _temp-buffer-name "*fixing Emacs permissions*")
(defconst _temp-buffer (get-buffer-create _temp-buffer-name))
(with-current-buffer _temp-buffer (erase-buffer))
@mrflip
mrflip / 20130416-todo.md
Last active January 21, 2024 21:06
Elasticsearch Tuning Plan

Next Steps

  • Measure time spend on index, flush, refresh, merge, query, etc. (TD - done)
  • Take hot threads snapshots under read+write, read-only, write-only (TD - done)
  • Adjust refresh time to 10s (from 1s) and see how load changes (TD)
  • Measure time of a rolling restart doing disable_flush and disable_recovery (TD)
  • Specify routing on query -- make it choose same node for each shard each time (MD)
  • GC new generation size (TD)
  • Warmers
  • measure before/after of client query time with and without warmers (MD)