Skip to content

Instantly share code, notes, and snippets.

View boxxxie's full-sized avatar
👙
disrupting absurdism

Paul Iannazzo boxxxie

👙
disrupting absurdism
View GitHub Profile
for f in (find . -type f)
sed -i 's/bad/good/g' $f
end
@idrm
idrm / imoment
Created November 26, 2014 14:28
Create imoment, an immutable version of moment.js.
;(function() {
var moment = this.moment;
var IMoment = function(m) {
this._m = m;
};
var m = moment();
@timrwood
timrwood / moment-immutable.js
Created September 16, 2014 17:16
Immutable Moments
(function (root, factory) {
"use strict";
if (typeof define === 'function' && define.amd) {
define(['moment'], factory);
} else if (typeof exports === 'object') {
module.exports = factory(require('moment'));
} else {
factory(root.moment);
}
}(this, function (moment) {
@john2x
john2x / 00_destructuring.md
Last active April 23, 2024 13:18
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@allgress
allgress / reagent_datascript.cljs
Last active February 16, 2023 21:16
Test use of DataScript for state management of Reagent views.
(ns reagent-test.core
(:require [reagent.core :as reagent :refer [atom]]
[datascript :as d]
[cljs-uuid-utils :as uuid]))
(enable-console-print!)
(defn bind
([conn q]
(bind conn q (atom nil)))
@mendelgusmao
mendelgusmao / btsync
Last active March 4, 2021 15:37
init.d script for btsync (based on another script built to run dropbox)
#!/bin/sh
### BEGIN INIT INFO
# Provides: btsync
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Multi-user daemonized version of btsync.
@krotscheck
krotscheck / gist:1962400
Created March 2, 2012 23:36
A quick Sproutcore nested document (for use with CouchDB) example.
This assumes the following document structure:
{
email: "myemail@mydomain.com",
firstName: "MyFirstName",
lastName: "MyLastName",
address: {
addressLine1: "Address Line 1",
addressLine2: "Address Line 2",
city: "Seattle",
@boxxxie
boxxxie / gist:1828125
Created February 14, 2012 17:00
_users couchdb
//http://blog.couchbase.com/what%E2%80%99s-new-couchdb-10-%E2%80%94-part-4-security%E2%80%99n-stuff-users-authentication-authorisation-and-permissions
//i wasn't able to do the curl stuff from the above site, but i was able to do stuff with $.couch in futon
//editing an existing user (need to be logged in as admin to do this)
$.couch.userDb(function(db){
db.openDoc("org.couchdb.user:10", //user name is "10"
{success:function(user){
user.roles.push("hello");
db.saveDoc(user);