Skip to content

Instantly share code, notes, and snippets.

@marianoguerra
marianoguerra / one-color-ieshim.js
Created September 6, 2012 10:43
fix for one-color #11
//taken from es5shim
(function () {
if (!Function.prototype.bind) {
Function.prototype.bind = function bind(that) { // .length is 1
// 1. Let Target be the this value.
var target = this;
// 2. If IsCallable(Target) is false, throw a TypeError exception.
if (typeof target != "function") {
throw new TypeError("Function.prototype.bind called on incompatible " + target);
@marianoguerra
marianoguerra / .jshintrc
Created November 3, 2012 11:12
my jshintrc
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : false, // Standard browser globals e.g. `window`, `document`.
"node" : false,
@marianoguerra
marianoguerra / om-next-with-specter.cljs
Last active October 13, 2015 15:25
First attempt at using specter with om.next, the mutate function is quite hacky since I'm sending all the info in the params and ignoring te query
(ns iorioui.core
(:require
[goog.dom :as gdom]
[om.next :as om :refer-macros [defui]]
[om.dom :as dom]
[com.rpl.specter :as s]
[cljs-http.client :as http]
[cljs.core.async :refer [<! >! put! chan]])
(:require-macros
[cljs.core.async.macros :refer [go]]))
@marianoguerra
marianoguerra / on-next-with-datascript.cljs
Created October 19, 2015 12:54
example of using on-next with datascript, trying to understand component composition and queries
(ns iorioui.core
(:require
[goog.dom :as gdom]
[om.next :as om :refer-macros [defui]]
[om.dom :as dom]
[com.rpl.specter :as s]
[datascript.core :as d]
[cljs-http.client :as http]
[cljs.core.async :refer [<! >! put! chan]])
(:require-macros
@marianoguerra
marianoguerra / .gitignore
Last active December 12, 2015 06:38
lein javac doesn't have access to :dependencies
/target
/lib
/classes
/checkouts
pom.xml
*.jar
*.class
.lein-deps-sum
.lein-failures
.lein-plugins
@marianoguerra
marianoguerra / README.rest
Last active December 20, 2015 03:08
Immutant error "Unable to obtain JMS Connection Factory - assuming we are outside the container" on 1.0.0.cr1

Immutant issue

error: Unable to obtain JMS Connection Factory - assuming we are outside the container

setup

:

@marianoguerra
marianoguerra / jboss-as-standalone.sh
Created August 12, 2013 14:26
init script to run immutant (or jboss) as a service on debian/ubuntu and derivatives
#!/usr/bin/env bash
#
# JBoss standalone control script
#
# chkconfig: - 80 20
# description: JBoss AS Standalone
# processname: standalone
# pidfile: /var/run/jboss-as/jboss-as-standalone.pid
# config: /etc/jboss-as/jboss-as.conf
@marianoguerra
marianoguerra / setup.sh
Created August 13, 2013 20:04
immutant race condition generator
lein immutant new breaker
cd breaker
cat src/immutant/init.clj
echo "(ns immutant.init (:require [immutant.messaging :as msg]))" > src/immutant/init.clj
echo '(msg/start "/queue/my-queue")' >> src/immutant/init.clj
echo '(msg/respond "/queue/my-queue" identity)' >> src/immutant/init.clj
for i in $(seq 1 10); do lein immutant deploy -n app-$i; done
lein immutant run
@marianoguerra
marianoguerra / linkode
Last active December 23, 2015 10:39
Small utility to create linkodes on the command line, it integrates nicely with vim (visual select and then <>! linkode -t python -b)
#!/usr/bin/env python
"""linkode utility"""
from __future__ import print_function
import sys
import argparse
import requests
import webbrowser
def parse_args():

when setting {include_src, false} on relx section on rebar.config and running:

rebar3 release

sources are included

when doing rebar3 as prod release

they are not