Skip to content

Instantly share code, notes, and snippets.

View rasheedamir's full-sized avatar

Rasheed Amir rasheedamir

View GitHub Profile
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;
public final class AutowiringSpringBeanJobFactory
extends SpringBeanJobFactory
implements ApplicationContextAware {
@rasheedamir
rasheedamir / AutowiringSpringBeanJobFactory.java
Created May 12, 2016 08:47 — forked from jelies/AutowiringSpringBeanJobFactory.java
Quartz (2.1.6) java config with spring (3.2.1). Using a SpringBeanJobFactory to automatically autowire quartz classes.
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.
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<changeSet id="1" author="sinossi">
<comment>Spring Security Authentication - Users Table</comment>
<createTable tableName="users">
<column name="username" type="varchar(50)">
<constraints primaryKey="true" nullable="false" />
@rasheedamir
rasheedamir / example.java
Created March 18, 2016 10:41 — forked from thurloat/example.java
Jackson JSON ignore on deserialize only
package com.thurloat.foo;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonProperty;
/**
* In order to write a composite data property (stats) out to JSON without reading
* it back in, you need to explicitly ignore the property, as well as the setter and
* then apply the @JsonProperty annotation to the getter.
**/
// ============================================================ //
// CAST
// ============================================================ //
window.chrome = {};
window.chrome.cast = {};
window.chrome.cast.isAvailable = true;
window.chrome.cast.initialize = function(a, b, c) { }
window.chrome.cast.ApiConfig = function(a, b, c) {
// This fakes that chromecast is available so the button appears
// call anything other than "available" to fake chromcast dissapearing
@rasheedamir
rasheedamir / README.md
Created November 2, 2015 12:20 — forked from andyshinn/README.md
CoreOS on Digital Ocean using Terraform

Terraform, CoreOS, and Digital Ocean

Let's use Terraform to easily get a CoreOS cluster up on Digital Ocean. In this example we will get a 5 node CoreOS cluster up and running on the Digital Ocean 8GB size.

Install Terraform

Grab a copy of Terraform for your platform from http://www.terraform.io/downloads.html. Follow the instructions at http://www.terraform.io/intro/getting-started/install.html by getting Terraform in your PATH and testing that it works.

Digital Ocean API Key

@rasheedamir
rasheedamir / README.md
Created October 26, 2015 15:00 — forked from digital-wonderland/README.md
Unit files to deploy an ElasticSearch cluster on CoreOS via Fleet
@rasheedamir
rasheedamir / uber-install-213.sh
Created October 19, 2015 19:16 — forked from dannguyen/uber-install-213.sh
Make everything install on Ubuntu 14.04 and 14.10, specifically for AWS and DigitalOcean
## Tested on 14.04 and 14.10. Runs as root because why not
## Installs:
# - Ubuntu developer tools
# - Python (using system 2.7.6 / 2.7.8)
# - scipy libs
# - scikit-learn
# - nltk
# - Ruby 2.1.5
# - rbenv
# - nokogiri
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
# Allow remote debugger connections (Default port is 6666)
Mule-3.4$ bin/mule -M-Dmule.debug.enable=true
# Change debugger port
Mule-3.4$ bin/mule -M-Dmule.debug.enable=true -M-Dmule.debug.port=8888
# Disable timeouts
Mule-3.4$ bin/mule -M-Dmule.debug.enable=true -M-Dmule.timeout.disable=true