Skip to content

Instantly share code, notes, and snippets.

View prog110's full-sized avatar

prog110 prog110

View GitHub Profile
curl -v -H "Cookie:ssid=48a1f862c16aed5ffe42265f0e0044b151d31446.1349046933.637835; geo=50.19.118.6%2CUS%2CWASHINGTON%2CSEATTLE%2C98144; L=tamil; B=bb5c4ba25d6186850cecda9ac9a35e7e" "/www.saavn.com/api.php?__call=search.getResults&q=Konjam%2520Koffee%2520Konjam%2520Kaadhal&p=1&_format=json&ctx=iphoneapp&_marker=false"
@prog110
prog110 / gist:c55b652cc9cd6831608e
Last active August 29, 2015 14:23
Blind vision for integration testing
@RunWith(JUnit4.class)
// Mockito + Spring integration/ use native @InjectMocks of mockito
@EnableMockedBean
// Spring MVC test configuration
@ContextConfiguration
@TestExecutionListeners({ DependencyInjectionTestExecutionListener.class,
DirtiesContextTestExecutionListener.class,
TransactionalTestExecutionListener.class,
// DBUnit & Spring integration
DbUnitTestExecutionListener.class })
@prog110
prog110 / introrx.md
Last active August 29, 2015 14:24 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@prog110
prog110 / build.gradle
Last active August 29, 2015 14:24 — forked from pietrom/build.gradle
apply plugin: 'java'
dependencies {
runtime group: 'org.hibernate', name: 'hibernate-core', version: '4.3.8.Final'
}
configurations {
runtime.exclude group: 'xml-apis', module: 'xml-apis'
runtime.exclude group: 'org.hibernate.javax.persistence', module: 'hibernate-jpa-2.1-api'
}
@prog110
prog110 / indian.districts.geocoded.pincode.json
Created September 25, 2015 21:19 — forked from prashnts/indian.districts.geocoded.pincode.json
Indian District's GeoCoded Pin Code Data
{
"_description: Name of City, or Town": {
"State": "The Indian State under which this City/Town exists.",
"GeoCode": [
"Latitude",
"Longitude"
],
"PinCodes": [
"All",
"The",
@prog110
prog110 / gist:e358b0f2c4a38de28f5d9c0024101b2f
Last active June 23, 2023 11:41
Running hardware accelerated emulator on Ubuntu 14.04 using system images on Intel x64 machines
1. Follow the instructions from (reference 2)
2. Follow the instructions from (reference 3)
If you are not able to run `sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils ia32-libs-multiarch` due to ia32-libs-multiarch, run the below commands
```sh
sudo -i
cd /etc/apt/sources.list.d
echo "deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse" > ia32-libs-raring.list
@prog110
prog110 / change-ip-tables.sh
Created May 12, 2016 18:53
AWS redirect port 80 -> 8080
iptables --insert INPUT --protocol tcp --dport 80 --jump ACCEPT
iptables --insert INPUT --protocol tcp --dport 8080 --jump ACCEPT
iptables --table nat --append PREROUTING --in-interface eth0 --protocol tcp --dport 80 --jump REDIRECT --to-port 8080
# run next line to have changes survive reboot
service iptables save
@prog110
prog110 / sfphp.vcl
Created May 13, 2016 15:50 — forked from mtougeron/sfphp.vcl
Varnish VCL for Apr 9, 2013 SFPHP Meetup
# VCL for Varnish - How to cache your dynamic pages
# SFPHP.org Apr 9, 2013
# See: https://github.com/varnish/libvmod-header
# This varnish mod allows us to easily manipulate the Set-Cookie responses
import header;
probe varnish_probe {
.url = "/ping";
.timeout = 2s;
@prog110
prog110 / build.gradle
Created July 1, 2016 10:35 — forked from kolorobot/build.gradle
Spring Boot with overridden Spring Version (with dependency management)
buildscript {
ext {
springBootVersion = '1.2.5.RELEASE'
}
ext['spring.version'] = '4.2.1.RELEASE'
repositories {
mavenCentral()
}
@prog110
prog110 / angular_documentation_fat_cleanup.user.js
Created December 24, 2016 09:41
Angular documentation, fat cleanup
// ==UserScript==
// @name Angular documentation, fat cleanup
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://angular.io/docs/*
// @grant none
// ==/UserScript==