Skip to content

Instantly share code, notes, and snippets.

View padcom's full-sized avatar

Matthias Hryniszak padcom

View GitHub Profile
@padcom
padcom / install-git.sh
Created June 19, 2011 10:23
Automated install of Git host on Ubuntu 10.04 with authorization and web interface for browsing
#!/bin/sh
#
# install required packages
#
apt-get install apache2 git-core gitweb
#
# create folder to host the repositories
#
@padcom
padcom / install.sh
Created August 3, 2011 09:26
Gitorious installation on Ubuntu 12.04
#!/bin/bash
#------------------------------------------------------------------------------
# SETTINGS
#------------------------------------------------------------------------------
MYSQL_ROOT_PASSWORD=password
MYSQL_GITORIOUS_PASSWORD=password
GITORIOUS_HOST=gitorious
SYSADMIN=sysadmin
@padcom
padcom / test.js
Created December 6, 2011 11:16
PhantomJS example
// ----------------------------------------------------------------------------
// Page object setup
// ----------------------------------------------------------------------------
var page = new WebPage();
page.onConsoleMessage = function(msg) {
console.log(msg);
};
@padcom
padcom / jquery.post-json.js
Created January 3, 2012 21:54
A shorthand method to posting JSON data using jQuery
(function($) {
$.postJSON = function(url, data, success, dataType) {
if (typeof data != 'string') {
data = JSON.stringify(data);
}
$.ajax({
url : url,
type: "post",
data: data,
dataType: dataType || "json",
@padcom
padcom / tail-log.rb
Created January 10, 2012 20:38
Tail logs from mongo collection
#!/usr/bin/ruby
require 'rubygems'
require 'mongo'
require 'json/pure'
require 'optparse'
require 'highline/import'
# utility function to convert a BSON:OrderedHash to regular hash
class BSON::OrderedHash
def to_h
@padcom
padcom / BootStrap.groovy
Created January 29, 2012 13:08
Grails+Ratpack example
def init = { servletContext ->
new Person(firstName: "John", lastName: "Doe").save(flush: true)
new Person(firstName: "Jane", lastName: "Smith").save(flush: true)
}
@padcom
padcom / gitorious_install_part1.sh
Created February 2, 2012 08:57 — forked from santiagoalvarez/gitorious_install_part1.sh
gitorious installer for debian 6
#!/bin/bash
mkdir /home/gitorious/
mkdir /home/gitorious/install/
cd /home/gitorious/install
apt-get update
apt-get install vim build-essential zlib1g-dev libcurl4-openssl-dev apache2 mysql-server mysql-client apg geoip-bin libgeoip1 libgeoip-dev libpcre3 libpcre3-dev zlib1g zlib1g-dev libyaml-dev libmysqlclient-dev apache2-dev libonig-dev zip unzip memcached git-core git-svn git-doc git-cvs libreadline-dev openjdk-6-jre sqlite3 libsqlite3-dev libmagick++3 libmagick++-dev libapache2-mod-xsendfile libxslt-dev libxml2-dev
wget http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise-1.8.7-2011.03.tar.gz
tar zxf ruby-enterprise-1.8.7-2011.03.tar.gz
ruby-enterprise-1.8.7-2011.03/installer
cd /opt && ln -s ruby-enterprise-1.8.7-2011.03/ ruby-enterprise
@padcom
padcom / Bundle.groovy
Created February 11, 2012 20:59
Grails script that creates a Zip archive for deployment
import grails.util.BuildScope
scriptScope = BuildScope.WAR
includeTargets << grailsScript("_GrailsWar")
includeTargets << grailsScript("_GrailsPackage")
target(prepareDistributionPackage: 'Creates a Zip archive for deployment') {
depends(checkVersion, configureWarName, war)
@padcom
padcom / StylesTagLib.groovy
Created February 11, 2012 21:33
Grails tag library providing tag to link CSS files
class StylesTagLib {
static namespace = "g"
def stylesheet = { args, body ->
out << """<link rel="stylesheet" href="${resource(dir: 'css', file: args.href)}" type="text/css"/>"""
}
}
@padcom
padcom / index.html
Created February 17, 2012 23:04
jQuery UI-based portal
<!doctype html>
<html>
<head>
<title>Portalizer</title>
<style>
html, body {
margin: 0; padding: 0;
}