Skip to content

Instantly share code, notes, and snippets.

View tlarevo's full-sized avatar

Tharindu Abeydeera tlarevo

View GitHub Profile
$token = $_POST['stripeToken'];
$charge = Stripe_Charge::create(
array(
// 'customer' => $customer->id,
'amount' => $courseFee,
'currency' => 'aud',
'source' => $token,
'description' => 'mahesh@gmail.com',
'application_fee' => 123
@tlarevo
tlarevo / rad-error.log
Created February 25, 2015 01:10
Error occurred when after running the merged code
06:21:42,663 ERROR [Main] [main] Error while starting up
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [spring-persistence-context.xml]
Offending resource: class path resource [spring-application-context.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring]
Offending resource: class path resource [spring-persistence-context.xml]
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importB
@tlarevo
tlarevo / dm2_rc_uat_error.log
Created September 18, 2014 10:02
DM2 RC UAT Error
[11:53:33,070]79055495 [pool-2-thread-18] FATAL processor.ProcessSMS - SMS : Session was already closed
org.hibernate.SessionException: Session was already closed
at org.hibernate.internal.SessionImpl.close(SessionImpl.java:343)
at processor.ProcessSMS.removeSCOSfromSubscriber(ProcessSMS.java:928)
at processor.ProcessSMS.supplementaryCosesProcess(ProcessSMS.java:631)
at processor.ProcessSMS.run(ProcessSMS.java:1543)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)
[11:53:33,071]79055496 [pool-2-thread-18] DEBUG processor.ProcessSMS - SMS : Closing opened hibernate session for SMS processing
@tlarevo
tlarevo / get_apn.php
Created September 9, 2014 06:02
Primitive method of getting APN queried for a specific MSISDN
<?php
$command = 'jruby'; // Jruby is the command we use to run the script file in future we'll improve app so it can be invoked without jruby
$path = ' /data01/HLR_CLI/get_apn.rb '; // path to the script
$arg_msisdn = '94787423363'; // assign the required msisdn
$apn = shell_exec(command + path + arg_msisdn); // execute 'shell_exec' command with given script path and msisdn as the argument
echo $apn; // print the apn
@tlarevo
tlarevo / mtm-gc.log
Created August 18, 2014 15:27
GC Logs
448491.684: [GC [PSYoungGen: 697088K->640K(697792K)] 1587653K->891285K(2095936K), 0.0140040 secs] [Times: user=0.09 sys=0.00, real=0.01 secs]
448500.364: [GC [PSYoungGen: 697152K->800K(697728K)] 1587797K->891553K(2095872K), 0.0130150 secs] [Times: user=0.12 sys=0.00, real=0.01 secs]
448509.227: [GC [PSYoungGen: 697312K->576K(697792K)] 1588065K->891401K(2095936K), 0.0212480 secs] [Times: user=0.20 sys=0.00, real=0.02 secs]
448520.613: [GC [PSYoungGen: 697152K->800K(697792K)] 1587977K->891681K(2095936K), 0.0137490 secs] [Times: user=0.10 sys=0.00, real=0.02 secs]
448529.221: [GC [PSYoungGen: 697376K->704K(697856K)] 1588257K->891665K(2096000K), 0.0147090 secs] [Times: user=0.13 sys=0.00, real=0.02 secs]
448538.548: [GC [PSYoungGen: 697408K->736K(697856K)] 1588369K->891753K(2096000K), 0.0225870 secs] [Times: user=0.10 sys=0.00, real=0.02 secs]
448550.705: [GC [PSYoungGen: 697440K->864K(697792K)] 1588457K->891969K(2095936K), 0.0125590 secs] [Times: user=0.11 sys=0.00, real=0.01 secs]
448559.473: [GC [PSYoungGen: 6
@tlarevo
tlarevo / python_resources.md
Created August 8, 2014 05:44 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@tlarevo
tlarevo / css_resources.md
Created August 8, 2014 05:44 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@tlarevo
tlarevo / rails_resources.md
Created August 8, 2014 05:44 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h
@tlarevo
tlarevo / javascript_resources.md
Created August 8, 2014 05:44 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@tlarevo
tlarevo / gist:0ef584b3c486c87e5ade
Created July 22, 2014 11:59
iOS Navigation without NavigationView
NSString * storyboardName = @"Main";
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle: nil];
UIViewController * myViewController = [storyboard instantiateViewControllerWithIdentifier:@"MY_VIEW"];
[self presentViewController:myViewController animated:YES completion:nil];