Skip to content

Instantly share code, notes, and snippets.

View rasheedamir's full-sized avatar

Rasheed Amir rasheedamir

View GitHub Profile
@rasheedamir
rasheedamir / Dockerfile
Created July 31, 2016 16:02
yeoman dockerfile based on Ubuntu 16.04 LTS
FROM phusion/baseimage:0.9.19
MAINTAINER Rasheed Amir <rasheed@aurorasolutions.io>
RUN echo "deb http://archive.ubuntu.com/ubuntu xenial main universe" > /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get -y install sudo nano git sudo zip bzip2 fontconfig wget
# install NodeJs
RUN curl -sL https://deb.nodesource.com/setup_4.x | sudo bash -
@rasheedamir
rasheedamir / ConvertJsonToHashMap.java
Created July 30, 2016 19:18
java code to convert json to hashmap using Google Gson library
String jsonBody = "Your JSON String";
HashMap<String, ArrayList<Map<String, Object>>> resultMap = new Gson().fromJson(jsonBody, new TypeToken<HashMap<String, ArrayList<Map<String, Object>>>>(){}.getType());
@rasheedamir
rasheedamir / json.txt
Created July 30, 2016 18:25
string json
{
"provider": [
{
"feedbackRating": 3.0,
"organizations": [
{
"address": {
"cityVillage": "Islamabad"
},
"name": "Specialist Dentists",
#!/bin/bash
SERVER_IP=<MY_SERVER_IP>
# copy cloud-config.yml to the server
scp cloud-config.yml core@$SERVER_IP:~/
# validate cloud-config file
ssh core@$SERVER_IP "coreos-cloudinit -validate --from-file ~/cloud-config.yml"
if [[ $? == "0" ]]; then
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