Skip to content

Instantly share code, notes, and snippets.

@teshi04
teshi04 / DeviceOwnerWriteActivity.java
Last active June 13, 2018 18:35
Device owner using NFC on Android Lollipop
MessageDigest digest = null;
try {
digest = MessageDigest.getInstance("SHA-1");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
byte[] apkBytes = new byte[0];
try {
apkBytes = IOUtils.toByteArray(getAssets().open("app-debug.apk"));
@staltz
staltz / introrx.md
Last active December 1, 2025 11:31
The introduction to Reactive Programming you've been missing
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active December 5, 2025 18:04
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=JSS15J
ro.build.display.id=JSS15J.I9505XXUEML1
ro.build.version.incremental=I9505XXUEML1
ro.build.version.sdk=18
ro.build.version.codename=REL
ro.build.version.release=4.3
ro.build.date=Tue Dec 10 14:28:08 KST 2013
ro.build.date.utc=1386653288
@ReeMii
ReeMii / image_download.php
Created March 15, 2014 11:11
Download image from url
<?php
function getimg($url, $path, $overwrite = false) {
$imageName= basename($url);
if(file_exists($path.$imageName) && !$overwrite) {
return $path.$imageName;
}
$headers[] = 'Accept: image/gif, image/x-bitmap, image/jpeg, image/pjpeg';
$headers[] = 'Connection: Keep-Alive';
@amgohan
amgohan / MongoConnectionManager.java
Last active August 29, 2017 20:40
Mongo Connection Manager using Morphia
import java.net.UnknownHostException;
import org.mongodb.morphia.Datastore;
import org.mongodb.morphia.Morphia;
import com.mongodb.MongoClient;
public class MongoConnectionManager {
private static final MongoConnectionManager INSTANCE = new MongoConnectionManager();
@christopherperry
christopherperry / adb+
Created July 30, 2012 16:12
A bash script that let's you issue adb commands to multiple devices at once
#!/bin/bash
# Script adb+
# Usage
# You can run any command adb provides on all your currently connected devices
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command>
#
# Examples
# ./adb+ version
# ./adb+ install apidemo.apk
# ./adb+ uninstall com.example.android.apis
@jxson
jxson / README.md
Created February 10, 2012 00:18
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@kitek
kitek / gist:1579117
Created January 8, 2012 17:50
NodeJS create md5 hash from string
var data = "do shash'owania";
var crypto = require('crypto');
crypto.createHash('md5').update(data).digest("hex");