Skip to content

Instantly share code, notes, and snippets.

View WSAyan's full-sized avatar
🎯
Focusing

Wahid Sadique Ayan WSAyan

🎯
Focusing
  • Wind Wallet
  • Dhaka,Bangladesh
View GitHub Profile
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@WSAyan
WSAyan / colors.xml
Last active October 2, 2018 04:44
Android colors file.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">@color/cyan_500</color>
<color name="colorPrimaryDark">@color/cyan_800</color>
<color name="colorAccent">#FF4081</color>
<color name="red_50">#ffebee</color>
<color name="red_100">#ffcdd2</color>
<color name="red_200">#ef9a9a</color>
<color name="red_300">#e57373</color>
@WSAyan
WSAyan / ActivityA.java
Created December 11, 2016 05:50
Stackoverflow answer, "Singleton in Android"
package com.example.testSingleton;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;
public class ActivityA extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
@WSAyan
WSAyan / uva_knightMoves_439.cpp
Last active December 11, 2016 06:02
BFS example
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<cstdlib>
#include<queue>
#include<vector>
#include<algorithm>
using namespace std;
int jump[8][2]={{1,2},{-1,-2},{-1,2},{1,-2},{2,1},{-2,-1},{-2,1},{2,-1}};
@WSAyan
WSAyan / unionFindDisjointSet.cpp
Last active March 7, 2017 04:49
Disjoint set example
#include<iostream>
using namespace std;
int par[100]={0};
int count=0;
void makeset(int n)
{
par[n]=n;
}
@WSAyan
WSAyan / uva_DarkRoads_11631.cpp
Last active December 11, 2016 06:15
Kruskals MST example
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<vector>
#include<algorithm>
#define MAXN 200003
using namespace std;
struct edge
{
@WSAyan
WSAyan / ImageHelper.java
Last active April 21, 2017 18:18
Android rounded image shaper
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Bitmap.Config;
import android.graphics.PorterDuff.Mode;
public class ImageHelper {
@WSAyan
WSAyan / android_glowing_background.xml
Created April 22, 2017 06:09
Multi color glowing background for android
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<gradient
android:startColor="#81C784"
android:centerColor="#4CAF50"
android:endColor="#2E7D32"
android:type="linear"
android:angle="135"/>
</shape>
@WSAyan
WSAyan / SessionManager.java
Last active July 18, 2017 05:32
Android SharedPreferences helper class. (EX: Log In session)
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
/**
* Created by WS Ayan on 11/24/2015.
*/
public class SessionManager {
private static String LOG = SessionManager.class.getSimpleName();
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class SqliteDatabseHandler extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 1;