Skip to content

Instantly share code, notes, and snippets.

View burhanaras's full-sized avatar
💭
Premature optimization is the root of all evil.

Burhan Aras burhanaras

💭
Premature optimization is the root of all evil.
View GitHub Profile
import Foundation
enum CurrencyPosition {
case left
case right
case none
}
class Money {
// Properties
import Foundation
enum CurrencyPosition {
case left
case right
case none
}
class Money {
// Properties
extension LinearGradient {
static func addLinearGradient(
colors: [Color] = [
Color(UIColor.alphaVariant40.withAlphaComponent(0.2)),
Color(UIColor.alphaVariant39)
]) -> LinearGradient {
return LinearGradient(
gradient: Gradient(colors: colors),
startPoint: .bottomLeading,
endPoint: .topTrailing
{
"appList": [{
"packageName": "com.paydustry.banking.nbademo.demo",
"transactionDetailsList": [{
"amountNeeded": true,
"financialDirection": "POSITIVE",
"supported": true,
"transactionName": "Sale",
"transactionType": "CREDIT",
"transactionWorkflowName": "com.paydustry.core.workflow.Sale"
{
"counttotal": "152",
"channellist": [{
"id": "89",
"foreignsn": "001309000000098698",
"type": "VIDEO_CHANNEL",
"name": "TV PLUS INFO",
"introduce": "TV PLUS INFO",
"mediaid": "9986",
"previewenable": "0",
@burhanaras
burhanaras / MainActivity.kt
Created May 2, 2018 07:44
This AsyncTask class should be static or leaks might occur
import android.os.AsyncTask
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.burhan.studentattendance.R
import java.lang.ref.WeakReference
class MainActivity : AppCompatActivity() {
private var mJustAVariable = 0
@burhanaras
burhanaras / MainActivity.kt
Created May 2, 2018 07:35
This AsyncTask class should be static or leaks might occur
import android.os.AsyncTask
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.burhan.studentattendance.R
import java.lang.ref.WeakReference
class MainActivity : AppCompatActivity() {
private var mJustAVariable = 0
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = FingerPrintingActivity.newIntent(MainActivity.this);
startActivity(intent);
}
});
@burhanaras
burhanaras / Singleton
Created January 11, 2014 15:18
A simple implementation of Singleton pattern
public class Singleton {
// Private constructor prevents instantiation from other classes
private Singleton() { }
/**
* SingletonHolder is loaded on the first execution of Singleton.getInstance()
* or the first access to SingletonHolder.INSTANCE, not before.
*/
private static class SingletonHolder {
public static final Singleton INSTANCE = new Singleton();
@burhanaras
burhanaras / gist:7806017
Created December 5, 2013 14:33
Bismillah
import javax.faces.bean.ManagedBean;
import nz.co.tradeintel.highcharts.ColumnChartSeries;
@ManagedBean
public class NZEthnicPopulation2006 {
private ColumnChartSeries nzEuropeanSeries = new ColumnChartSeries();
private ColumnChartSeries maoriSeries = new ColumnChartSeries();
private ColumnChartSeries pacificSeries = new ColumnChartSeries();
private ColumnChartSeries asianSeries = new ColumnChartSeries();