Skip to content

Instantly share code, notes, and snippets.

View vijedi's full-sized avatar

Tejus Parikh vijedi

View GitHub Profile
@vijedi
vijedi / version_update.rake
Created November 5, 2011 15:03
version_update.rake
NAMESPACE_MAP = {'ns' => 'http://maven.apache.org/POM/4.0.0'}
require 'nokogiri'
require 'find'
namespace :mvn do
desc "[path, version] upgrade this version and all of it's children to the version specified as the second character"
task :version, :path, :version_str do |t, args|
base_path = args[:path]
version = args[:version_str]
puts "Updating all poms in #{base_path} to parent version #{version}"
@vijedi
vijedi / deps.out
Created November 21, 2011 15:07
The Hector library's dependencies make no sense
[INFO] +- me.prettyprint:hector-core:jar:1.0-1:compile
[INFO] | +- commons-pool:commons-pool:jar:1.5.3:compile
[INFO] | +- org.apache.cassandra:cassandra-thrift:jar:1.0.0:compile
[INFO] | +- org.apache.thrift:libthrift:jar:0.6.1:compile
[INFO] | | \- org.slf4j:slf4j-log4j12:jar:1.5.8:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] | +- com.github.stephenc.eaio-uuid:uuid:jar:3.2.0:compile
[INFO] | \- com.ecyrd.speed4j:speed4j:jar:0.9:compile
@vijedi
vijedi / spring_aop_class_example.java
Created January 6, 2012 01:44
Spring AOP Class Example
@Transactional
@Service
class DependencyClass implements IDependencyClass {
}
class MainClass {
@Autowired
private IDependencyClass insert;
}
@vijedi
vijedi / spring_aop_class_example_two_classes.java
Created January 6, 2012 02:04
Spring AOP Class Example With Two Classes
@Transactional
@Service
class DependencyClass implements IDependencyClass {
}
@Transactional
@Service
class DependencyClassAlternate implements IDependencyClass {
@vijedi
vijedi / spring_aop_classes_with_qualifiers.java
Created January 6, 2012 02:08
Spring AOP Classes with Qualifiers
@Transactional
@Service("dc")
class DependencyClass implements IDependencyClass {
}
@Transactional
@Service("dca")
class DependencyClassAlternate implements IDependencyClass {
@vijedi
vijedi / csrf.js
Created February 8, 2012 13:08
CSRF Token: The Wrong way.
$("body").bind("ajaxSend", function(elm, xhr, s){
if (s.type == "POST") {
xhr.setRequestHeader('X-CSRF-Token', Common.CSRF_TOKEN);
}
});
@vijedi
vijedi / csrf_token.js
Created February 8, 2012 13:21
Correct CSRF Token
$("body").bind("ajaxSend", function(elm, xhr, s){
if (s.type == "POST" || type == "DELETE" || type == "PUT") {
xhr.setRequestHeader('X-CSRF-Token', Common.CSRF_TOKEN);
}
});
@vijedi
vijedi / fetch_git_changes.sh
Created May 26, 2012 15:10
Fetching All Repo Changes
git remote add <remote_name> </path/to/existing/repo>
git fetch <remote_name>
git merge <remote_name>/master
@vijedi
vijedi / create_repo.sh
Created May 26, 2012 15:05
Create a Git Repo
mkdir monolithic_repo
cd monolithic_repo
git init .
@vijedi
vijedi / adding_moved_files_to_git.sh
Created May 26, 2012 17:24
Adding moved files to git
git add <subdir_name>
git add -u
git commit -m "adding <subdir_name>"