Skip to content

Instantly share code, notes, and snippets.

@guybrush
guybrush / nodeconf_2011.md
Created May 6, 2011 07:22
a list of slides from nodeconf 2011
@rwjblue
rwjblue / readme.md
Last active May 13, 2016 18:10
Guide to using drip with JRuby

#Overview drip is an awesome command line tool that can be used to dramatically lower perceived JVM startup time. It does this by preloading an entirely new JVM process\instance and allowing you to simply use the preloaded environment. This has extraordinary results with jruby.

We reduced time to run rake environment from 13 seconds to a mere 3.5 seconds. This is actually at or near MRI 1.9.3p327 (with falcon patch) speeds!

Adding a few addition jruby options will reduce startup time even further (down to 1.69 seconds).

#Install Drip Install drip if you haven't already (see https://github.com/flatland/drip)

@jeremyheiler
jeremyheiler / with-system-out-str.clj
Last active March 13, 2019 16:50
Hijacking System.out with Clojure
(defmacro with-system-out-str
[& body]
`(let [out# System/out
buf# (java.io.ByteArrayOutputStream.)
prs# (java.io.PrintStream. buf#)
wtr# (java.io.OutputStreamWriter. prs#)]
(try
(System/setOut prs#)
(binding [*out* wtr#]
(do ~@body))
@afeld
afeld / README.md
Last active August 27, 2019 05:04
archive inactive GitHub repositories in an organization
@jffry
jffry / gen.clj
Created November 18, 2019 01:57
Clojure/conj 2019 Schedule
;; Run me with:
;; clojure -Sdeps '{:deps {org.jsoup/jsoup {:mvn/version "1.12.1"}}}' gen.clj
(require '[clojure.string :as str])
(import (java.time.format DateTimeFormatter)
(java.time LocalDate LocalTime ZoneId ZonedDateTime)
(java.util UUID)
(org.jsoup Jsoup)
(org.jsoup.nodes Document))
@AlexVPopov
AlexVPopov / clojure.spec cheat sheet.md
Last active February 21, 2020 07:08
A cheat sheet for clojure.spec

clojure.spec cheat sheet

Specs

Require

(ns my.ns
  (:require [clojure.spec.alpha :as s]))
@Folcon
Folcon / clipboard-utils.clj
Created August 24, 2011 11:50
Just a quick clipboard slip/slurp I put together because I didn't find anything similar, don't know if it's useful for anyone but found it invaluable when getting large strings being returned from the repl and sticking the result in an editor for more car
(defn get-clipboard []
(.getSystemClipboard (java.awt.Toolkit/getDefaultToolkit)))
(defn slurp-clipboard []
(try
(.getTransferData (.getContents (get-clipboard) nil) (java.awt.datatransfer.DataFlavor/stringFlavor))
(catch java.lang.NullPointerException e nil)))
(defn spit-clipboard [text]
(.setContents (get-clipboard) (java.awt.datatransfer.StringSelection. text) nil))
@ybiquitous
ybiquitous / skip-ci-on-actions.yml
Last active February 9, 2021 10:11
How to "[skip ci]" on GitHub Actions
# See also:
# - https://github.com/actions/runner/issues/774
# - https://help.github.com/en/actions/reference/events-that-trigger-workflows#push-event-push
# - https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
# - https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
name: "[skip ci]" on Actions
on: [push, pull_request]
@mhart
mhart / ci.yml
Last active May 23, 2022 04:36
GitHub Actions running 5 tslint jobs in parallel (each tests every 5th file)
name: CI
on: [push]
jobs:
tslint:
runs-on: ubuntu-latest
strategy:
matrix:
job: [0, 1, 2, 3, 4]
@mhart
mhart / npm-ci.sh
Created September 28, 2019 18:26
Simple module caching script, for CI or similar
#!/bin/bash -ex
# Tries to download latest cached node_modules based on package-lock.json
# If it can't, then `npm ci` and push up node_modules to cache
# Assumes S3_BUCKET env var has been set, and that `aws` credentials
# are configured (either in env, or ~/.aws/credentials)
CHECKSUM=$(sha256sum package-lock.json | awk '{print $1}')