Skip to content

Instantly share code, notes, and snippets.

View prayagupa's full-sized avatar
💭
Neta

Prayag prayagupa

💭
Neta
View GitHub Profile
@agaoglu
agaoglu / MockHTable.java
Created October 6, 2010 11:34
MockHTable
/**
* This file is licensed to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
(require 'cl)
(defun indent-if-blank ()
(interactive "*")
(progn
(flet ((error (&REST) nil))
(indent-according-to-mode))
(delete-trailing-whitespace-this-line)))
(defun indent-newline-and-indent ()
@ghostm
ghostm / MongoProtoUser.scala
Created November 11, 2010 05:53
MetaMegaProtoUser that uses Mongo
/*
Copyright 2012 Matthew Henderson
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@snuggs
snuggs / .tmux.conf
Last active August 22, 2024 14:22
IDE & TMUX Configuration
############################################################################
# _
# | |_ _ __ ___ _ ___ __
# | __| '_ ` _ \| | | \ \/ /
# | |_| | | | | | |_| |> <
# \__|_| |_| |_|\__,_/_/\_\
#
# Cheatsheets:
# https://devhints.io/tmux
# `property not found` issue:
@huljas
huljas / PrintSchemaUpdate.java
Created February 12, 2011 19:45
Example on how you could use Hibernate schema update when creating database migrations for play applications.
package play.modules.migrate;
import org.hibernate.dialect.MySQL5Dialect;
import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.tool.hbm2ddl.DatabaseMetadata;
import play.Play;
import play.db.DB;
import play.db.DBPlugin;
import play.utils.Utils;
@turadg
turadg / rake.sh
Created February 23, 2011 16:28
Bash completion for ruby Rake
# bash completion for rake
#
# some code from on Jonathan Palardy's http://technotales.wordpress.com/2009/09/18/rake-completion-cache/
# and http://pastie.org/217324 found http://ragonrails.com/post/38905212/rake-bash-completion-ftw
#
# For details and discussion
# http://turadg.aleahmad.net/2011/02/bash-completion-for-rake-tasks/
#
# INSTALL
#
@tbatchelli
tbatchelli / pallet-vmfest.md
Created March 12, 2011 20:25
Setup pallet with vmfest
  1. Install VirtualBox on your machine
  2. Disable login credential: $ VBoxManage setproperty websrvauthlibrary null
  3. Download and uncompress the following image https://s3.amazonaws.com/vmfest-images/ubuntu-10-10-64bit-server.vdi.gz
  4. Clone the image to the directory where you want it to be permanently stored: $ VBoxManage clonehd /path/to/downloaded/ubuntu-10-10-64bit-server.vdi /path/to/permanent/location/ubuntu...-server.vdi
    • This should produce a uuid for your new image. Keep it around
  5. Start VirtualBox (the GUI) and:
    1. Create an new image Linux - Ubuntu (64bit)
  6. Select "Use existing hard disk" and if your newly cloned image doesn't appear in the drop-down list, click on the folder icon and find the image in your hard disk (the one you just cloned)
;; without cake-pallet
"/Users/sritchie/.rvm/gems/ruby-head/gems/cake-0.6.2/lib/bake.jar:/Users/sritchie/.rvm/gems/ruby-head/gems/cake-0.6.2/lib/cake.jar:/Users/sritchie/.rvm/gems/ruby-head/gems/cake-0.6.2/lib/clojure.jar:src:src/clj:lib/dev/pallet-lein-0.4.0.jar:lib/dev/swank-clojure-1.2.1.jar:/Users/sritchie/.cake/lib/dev/*"
;; with cake-pallet
"/Users/sritchie/.rvm/gems/ruby-head/gems/cake-0.6.2/lib/bake.jar:/Users/sritchie/.rvm/gems/ruby-head/gems/cake-0.6.2/lib/cake.jar:/Users/sritchie/.rvm/gems/ruby-head/gems/cake-0.6.2/lib/clojure.jar:src:src/clj:lib/dev/aopalliance-1.0.jar:lib/dev/bcprov-jdk15-1.44.jar:lib/dev/cake-pallet-0.4.0.jar:lib/dev/clj-http-0.1.1.jar:lib/dev/clj-ssh-0.2.0.jar:lib/dev/commons-codec-1.4.jar:lib/dev/commons-io-1.4.jar:lib/dev/commons-logging-1.1.1.jar:lib/dev/enlive-1.0.0.jar:lib/dev/gson-1.5.jar:lib/dev/guava-r06.jar:lib/dev/guice-2.1-r1201.jar:lib/dev/httpclient-4.0.1.jar:lib/dev/httpcore-4.0.1.jar:lib/dev/inject-1.0.jar:lib/dev/jclouds-blobstore-1.0-beta-8.jar:lib/dev/jclouds
@jimeh
jimeh / com.rabbitmq.rabbitmq-server.plist
Created March 24, 2011 10:47
Mac OS X launchctl plist for Homebrew-based RabbitMQ installations. Place in: ~/Library/LaunchAgents
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.rabbitmq.rabbitmq-server</string>
<key>Program</key>
<string>/usr/local/sbin/rabbitmq-server</string>
@niwo
niwo / svn_autocommit.sh
Created March 25, 2011 11:23
Bash script for auto-committing from a SVN working copy
#!/bin/bash
### Settings
svn_wk='/srv/tftp/data/'
svn_user='user'
svn_passwd='passwd'
### Variables
date=`date +"%F %T"`
svn='/usr/bin/svn'