Skip to content

Instantly share code, notes, and snippets.

@marianoguerra
marianoguerra / core.clj
Created June 10, 2014 14:48
immutant 1.1.2 and tools.logging error
(ns logerror.core
(:require
[immutant.cache :as cache]
[clojure.tools.logging :as log]))
(println #'clojure.tools.logging/*logger-factory*)
(try
(def my-cache (cache/create "cache"))
(catch Exception e
(println #'clojure.tools.logging/*logger-factory*)))
@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():
@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 / 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 / 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 / .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 / otr.py
Created November 6, 2012 10:36
otr support for sleekxmpp
import pyotr
from sleekxmpp.xmlstream.stanzabase import JID
import logging
log = logging.getLogger(__name__)
from plugin import BasePlugin
import tabs
from tabs import ConversationTab
@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 / 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 / README.rst
Created August 10, 2012 09:04
Jquery 1.8.0 and Jquery UI 1.8.22 dialog buttons bug

this gist is an example to reproduce a bug when using Jquery 1.8.0 and Jquery UI 1.8.22 and trying to set the buttons with an array of objects.

the example works if jquery is 1.7.2 but not with 1.8.0

to test

live test