Skip to content

Instantly share code, notes, and snippets.

View arnabmitra's full-sized avatar
🙈

Arnab Mitra arnabmitra

🙈
View GitHub Profile
@arnabmitra
arnabmitra / gist:3616535
Created September 4, 2012 04:20 — forked from anonymous/gist:3616529
Watch online The Colbert Report, Martin Sheen 4 Sep, 2012
Watch online The Colbert Report, Martin Sheen 4 Sep, 2012 The Colbert Report, Martin Sheen, streaming, streaming The Colbert Report, watch The Colbert Report Martin Sheen
package com.jelies.spring3tomcat7.config.quartz;
import org.quartz.spi.TriggerFiredBundle;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.scheduling.quartz.SpringBeanJobFactory;
/**
* This JobFactory autowires automatically the created quartz bean with spring @Autowired dependencies.
package spring;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.stream.IntStream;
import java.util.stream.Stream;
/**
* Created by amitra on 1/24/16.
*/
public class Sample {
public static boolean isPrime(int n)
@Configuration
@EnableResourceServer
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter {
@Inject
What if you want to squash all your commits to one commit
git rebase -i d670953
git log --oneline
pick b76d157 b
pick a931ac7 c
# Rebase df23917..a931ac7 onto df23917
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.stream.IntStream;
public class Solution {
Installing Cassandra on Mac OS X
Install Homebrew
Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Install Python
Mac OS X has a copy of Python preinstalled, but this makes sure you get the newest version.
Redis is an open source, BSD-licensed, key-value data store that also comes with a messaging system. The server is freely available at http://redis.io/download.
If you use a Mac with homebrew
brew install redis
Once you unpack Redis, you can launch it with default settings.
redis-server
You should see a message like this:
[35142] 01 May 14:36:28.939 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
[35142] 01 May 14:36:28.940 * Max number of open files set to 10032
_._
View all branches
git branch -a
Checkout new branch
git checkout "branch-name"
ammend latest commit
git commit --amend
--checkout a branch