Skip to content

Instantly share code, notes, and snippets.

View firoze's full-sized avatar

Firoze Rakib firoze

  • Fieldwire
  • San Francisco
  • X @frzrkb
View GitHub Profile
@firoze
firoze / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@firoze
firoze / AsyncGetLocationForStoreTask
Created December 11, 2014 23:14
AsyncTask that gets Lat/Long using Geocoder first, otherwise makes HTTP call to Google Geocoding API to do the same (inspired by @kentarosu)
class AsyncGetLocationForStoreTask extends AsyncTask<String, Integer, Location> {
private ProgressDialog pDialog;
private String str;
public AsyncGetLocationForStoreTask(String s) {
str = s;
}
@Override
@firoze
firoze / git-loglive
Created December 22, 2014 14:41
Git Log Live
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $*
sleep 1
done
Thepathof
therighteousmanis
besetonallsidesbytheiniq
uitiesoftheself ishandth
etyrannyofevi lmen.Bl
essedishewho,in thenam
eofcharityandgoo dwill
,shepherdst heweak throughthev alley
ofdarkness,forheist rulyhisbrother' skee
perandthefinderof lostchildren.AndIwill
@firoze
firoze / java_sha1
Created January 15, 2015 04:17
SHA1 Some String in Java
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class HashTextTest {
/**
* @param args
* @throws NoSuchAlgorithmException
*/
public static void main(String[] args) throws NoSuchAlgorithmException {
@firoze
firoze / instaService
Last active August 29, 2015 14:22
Cordova Instagram wrapper
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 / delay.promise.js
Created November 29, 2017 05:17
Delayer Promise
function delay(t){
return new Promise(function(resolve){
return setTimeout(resolve, t);
});
}
function logHi(){
console.log('hi');
}
@firoze
firoze / OkHttpIdlingResource.kt
Created January 28, 2020 00:32
OkHttpIdlingResource in Kotlin
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 {
@firoze
firoze / jenkins_android_gradle_buildNum
Last active June 13, 2021 19:14
[Android Gradle] Auto-Increment version code/name in AndroidManifest/Gradle before Jenkins Build
import java.util.regex.Pattern
def versionMajor = 1
def versionMinor = 0
def versionPatch = 0
buildscript {
repositories {
mavenCentral()
}
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled