Skip to content

Instantly share code, notes, and snippets.

Avatar

Firoze Rakib firoze

  • Mobiquity Inc.
View GitHub Profile
@firoze
firoze / OkHttpIdlingResource.kt
Created Jan 28, 2020
OkHttpIdlingResource in Kotlin
View OkHttpIdlingResource.kt
import androidx.annotation.CheckResult
import androidx.annotation.NonNull
import androidx.test.espresso.IdlingResource
import okhttp3.Dispatcher
import okhttp3.OkHttpClient
class OkHttpIdlingResource private constructor(
private val resourceName: String, private val dispatcher: Dispatcher
) : IdlingResource {
companion object {
View delay.promise.js
function delay(t){
return new Promise(function(resolve){
return setTimeout(resolve, t);
});
}
function logHi(){
console.log('hi');
}
@firoze
firoze / instaService
Last active Aug 29, 2015
Cordova Instagram wrapper
View instaService
angular.module("ycf").factory("ycfInstagram", function($q, social, groupVerification, loadingDialog, validationAlert, $ionicPopup) {
var insta = {};
insta.msg = "Support my YC Fundraiser!";
insta.post = function(type) {
if (type == "marketing") {
return insta.market();
} else {
return insta.invite();
@firoze
firoze / java_sha1
Created Jan 15, 2015
SHA1 Some String in Java
View java_sha1
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class HashTextTest {
/**
* @param args
* @throws NoSuchAlgorithmException
*/
public static void main(String[] args) throws NoSuchAlgorithmException {
View gist:f1fa582000ecd817547c
Thepathof
therighteousmanis
besetonallsidesbytheiniq
uitiesoftheself ishandth
etyrannyofevi lmen.Bl
essedishewho,in thenam
eofcharityandgoo dwill
,shepherdst heweak throughthev alley
ofdarkness,forheist rulyhisbrother' skee
perandthefinderof lostchildren.AndIwill
View git-loglive
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $*
sleep 1
done
@firoze
firoze / AsyncGetLocationForStoreTask
Created Dec 11, 2014
AsyncTask that gets Lat/Long using Geocoder first, otherwise makes HTTP call to Google Geocoding API to do the same (inspired by @kentarosu)
View AsyncGetLocationForStoreTask
class AsyncGetLocationForStoreTask extends AsyncTask<String, Integer, Location> {
private ProgressDialog pDialog;
private String str;
public AsyncGetLocationForStoreTask(String s) {
str = s;
}
@Override
@firoze
firoze / jenkins_android_gradle_buildNum
Last active Mar 24, 2020
[Android Gradle] Auto-Increment version code/name in AndroidManifest/Gradle before Jenkins Build
View jenkins_android_gradle_buildNum
import java.util.regex.Pattern
def versionMajor = 1
def versionMinor = 0
def versionPatch = 0
buildscript {
repositories {
mavenCentral()
}
@firoze
firoze / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.