Skip to content

Instantly share code, notes, and snippets.

View budhash's full-sized avatar

Budhaditya budhash

  • San Francisco Bay Area
View GitHub Profile
@budhash
budhash / Trace.aj
Created June 6, 2012 17:28
AspectJ trace
import java.io.PrintStream;
/**
*
* This class provides support for printing trace messages into a stream.
* Trace messages are printed before and after constructors and methods
* are executed.
* The messages are appended with the string representation of the objects
* whose constructors and methods are being traced.
* It defines one abstract pointcut for injecting that tracing functionality
@budhash
budhash / CodeDocumentJava.links
Created September 13, 2012 22:37
Links for Java Code Documentation
@budhash
budhash / org.eclipse.jetty.plist
Created October 23, 2012 05:20 — forked from mystix/org.eclipse.jetty.plist
Jetty 6 & 7 launchd plists for OSX
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><!-- NOTE: place this file in /Library/LaunchDaemons -->
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>org.eclipse.jetty</string>
<key>ServiceDescription</key>
<string>Jetty 7</string>
# Apt-install various things necessary for Ruby, guest additions,
# etc., and remove optional things to trim down the machine.
apt-get -y update
apt-get -y remove apparmor
apt-get -y install linux-headers-$(uname -r) build-essential
apt-get -y install zlib1g zlib1g-dev libxml2 libxml2-dev libxslt-dev libssl-dev openssl libreadline5-dev
apt-get clean
# Remove this file to avoid dhclient issues with networking
rm -f /etc/udev/rules.d/70-persistent-net.rules
# **postinstall.sh** is a script executed after Debian/Ubuntu has been
# installed and restarted. There is no user interaction so all commands must
# be able to run in a non-interactive mode.
#
# If any package install time questions need to be set, you can use
# `preeseed.cfg` to populate the settings.
### Setup Variables
# The version of Ruby to be installed supporting the Chef and Puppet gems
@budhash
budhash / squareatcoord.js
Created August 21, 2013 18:03
A javascript snippet to create a square at the given coordinates.
javascript:(function (id,L,T,W,H,bgColor) {
if (document.getElementById) {
if (document.getElementById(id)) { document.body.removeChild(document.getElementById(id)); }
var highest_index = 0;
var elements = document.getElementsByTagName("*");
for (var i = 0; i < elements.length - 1; i++) {
//console.log(elements[i].style.zIndex);
if (parseInt(elements[i].style.zIndex) > highest_index) {
highest_index = parseInt(elements[i].style.zIndex);
@budhash
budhash / JMeterCodeRunner.java
Created April 8, 2014 22:19
How to create and run Apache JMeter Test Scripts from a Java program?
import org.apache.jmeter.control.LoopController;
import org.apache.jmeter.engine.StandardJMeterEngine;
import org.apache.jmeter.protocol.http.sampler.HTTPSampler;
import org.apache.jmeter.testelement.TestElement;
import org.apache.jmeter.testelement.TestPlan;
import org.apache.jmeter.threads.SetupThreadGroup;
import org.apache.jmeter.util.JMeterUtils;
import org.apache.jorphan.collections.HashTree;
public class JMeterCodeRunner {
@budhash
budhash / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
http://saltnlight5.blogspot.com/2012/08/a-better-java-shell-script-wrapper.html
@budhash
budhash / openssl-maker.sh
Last active September 10, 2015 19:15 — forked from letiemble/openssl-maker.sh
A bash script to generate "all-in-one" OpenSSL static libraries for OS X and iOS. The script produces fat static libraries (i386,x86_64 for OS X) and (i386,armv7,armv7s,arm64 for iOS) suitable for integration in both OS X and iOS project.
#!/bin/bash
###############################################################################
## ##
## Build and package OpenSSL static libraries for OSX/iOS ##
## ##
## This script is in the public domain. ##
## Creator : Laurent Etiemble ##
## ##
###############################################################################