Skip to content

Instantly share code, notes, and snippets.

View kastork's full-sized avatar

Kirk Stork kastork

View GitHub Profile
@kastork
kastork / Classpath control inside Jython script
Created February 3, 2011 20:57
Here's a quick little method to take control of the classpath right inside a Jython script.
import sys
...
def setClassPath():
libDir = "/path/to/my/jar/files/"
classPaths = [
"foo.jar",
"bar.jar"
]
@kastork
kastork / node-and-npm-in-30-seconds.sh
Created January 16, 2012 22:17 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
On my OSX Lion box with an up to date MacPorts installation the following does not work
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
@kastork
kastork / noodle.xml
Created June 26, 2012 01:41
OpenSocial gadget example
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Gifts part 1 - Friends">
<Require feature="opensocial-0.8"/>
<Require feature="dynamic-height" />
</ModulePrefs>
<Content type="html">
<![CDATA[
<script type="text/javascript">
function loadFriends() {
@kastork
kastork / gist:4596497
Created January 22, 2013 17:30
example portal-log4j.xml to put in a plugin project's META-INF
<?xml version="1.0"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<category name="edu.nps.eccogs.eccoag">
<priority value="DEBUG" />
</category>
</log4j:configuration>
@kastork
kastork / server.groovy
Created February 3, 2013 23:45
Basic example of a CAS login and logout route in a Vertx Route Matcher application.
import org.vertx.groovy.core.http.RouteMatcher
import org.vertx.groovy.core.http.HttpClient
import org.vertx.groovy.core.http.HttpClientRequest
import org.vertx.groovy.core.http.HttpServerResponse
import org.vertx.groovy.core.http.HttpClientResponse
// made with with vertx 1.3.0
// set your own CAS server details,
//
@kastork
kastork / gist:5118301
Created March 8, 2013 17:44
Add a Liferay user via JSON Web Service
@Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='0.7.2')
import wslite.rest.*
import wslite.http.auth.*
println "This is the add user script"
def client = new RESTClient("http://localhost:8080/api/jsonws/")
client.authorization = new HTTPBasicAuthorization("test@liferay.com", "test")
client.httpClient.sslTrustAllCerts = true
@kastork
kastork / AddLiferayUsers.groovy
Last active December 14, 2015 23:09
Liferay Batch user addition using Groovy and the Liferay JSON-WS API
// We assume that the input file 'users.csv' is a three field
// comma separated list of users
// John Q. User, john@example.com, password_ofjohn
//
// Password can be empty, but the csv still needs a field there
//
// John Q. User, john@example.com,
// (note the trailing comma)
//
// The name field must have at least two tokens. If there are three or more
@kastork
kastork / index.htm
Created February 18, 2014 16:36 — forked from bennadel/index.htm
Group-by workaround for Angular
<!doctype html>
<html ng-app="Demo" ng-controller="DemoController">
<head>
<meta charset="utf-8" />
<title>
Grouping Nested ngRepeat Lists In AngularJS
</title>
</head>
<body>
@kastork
kastork / gist:55d4cbb76b016d44d260
Created October 2, 2014 14:56
Enable Internet Explorer Developer Tools
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\IEDevTools]
"Disabled"=-
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\IEDevTools]
"Disabled"=-
SIMTIME SOURCE CALL SOURCE CHANGE_TRIGGER STACK TREE TOP
1.01 B_AH-1Z_H1 null ADD_GOAL
default
TacAirCycle true
fires
B_RW_BasicBehavior true
3.0 B_AH-1Z_H1 null ADD_GOAL
default
TacAirCycle true
fires