Skip to content

Instantly share code, notes, and snippets.

View udoyen's full-sized avatar

george udosen udoyen

View GitHub Profile
@udoyen
udoyen / DBMS.java
Created July 17, 2018 21:42 — forked from jcxavier/DBMS.java
Singleton database class for Android for quickly starting developing an application with a database being created from a SQL script
/*
* Copyright (C) 2011 João Xavier
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@udoyen
udoyen / ViewVisibilityIdlingResource.java
Created July 27, 2018 04:53 — forked from vaughandroid/ViewVisibilityIdlingResource.java
An IdlingResource for Espresso which blocks until a View has a particular visibility state.
package com.vaughandroid.test.espresso.idlingresources;
import android.app.Activity;
import android.os.Handler;
import android.support.annotation.IdRes;
import android.support.annotation.NonNull;
import android.support.test.espresso.*;
import android.view.View;
import java.lang.ref.WeakReference;
@udoyen
udoyen / _service.md
Created August 15, 2018 16:40 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@udoyen
udoyen / fuse.md
Created August 19, 2018 21:06 — forked from cstroe/fuse.md
FUSE on Ubuntu

FUSE on Ubuntu

It seems that Fuse is compiled into the Ubuntu kernel by default.

To test you can use sshfs:

sudo apt-get install sshfs
mkdir tmp
sshfs localhost:/tmp ./tmp

ls tmp

Keybase proof

I hereby claim:

  • I am udoyen on github.
  • I am udoyen (https://keybase.io/udoyen) on keybase.
  • I have a public key whose fingerprint is FB05 B7B3 FEDE 7EF8 A6B2 AF2C 64E5 DDBA CD55 E285

To claim this, I am signing this object:

@udoyen
udoyen / cifs-mount.md
Created September 16, 2018 17:19 — forked from ipbastola/cifs-mount.md
How to mount CIFS into Ubuntu 14.04-x64 LTS

CIFS Mount on Ubuntu 14.04

1. Install packages

$ sudo apt-get install cifs-utils

2. Create a Mount point Directory

$ sudo mkdir /mnt/CIFSMOUNT
// create a java calendar instance
Calendar calendar = Calendar.getInstance();
// get a java date (java.util.Date) from the Calendar instance.
// this java date will represent the current date, or "now".
java.util.Date currentDate = calendar.getTime();
// now, create a java.sql.Date from the java.util.Date
java.sql.Date date = new java.sql.Date(currentDate.getTime());
@udoyen
udoyen / sample_storedprocedure.txt
Last active January 19, 2019 14:09
Sample of StoredProcedure
CallableStatement cstmt = conn.prepareCall(
"{call StoredProcedureName ( [Parameter Definition] ) }"
)
Types of parameters allowed include:
1) Input(Default)
2) Output
3) Input Output
To Set the Parameters we use:
@udoyen
udoyen / mysql_storedprocedure.sql
Last active January 24, 2019 11:28
StoredProcedure for Mysql
DELIMITER //
DROP PROCEDURE IF EXISTS addnewemployee //
CREATE PROCEDURE addnewemployee
(
IN eno int(11),
IN ebdate date,
IN efname varchar(14),
IN elname varchar(16),
IN egender enum('M', 'F'),
IN ehdate date
@udoyen
udoyen / JavaKeys.java
Created January 26, 2019 08:59
Java explicit key creation example
public class Person {
private final Object key = new Object();
public String init() {
synchronized(key) {
// Do stuff
}
}
}