Skip to content

Instantly share code, notes, and snippets.

View TurhanOz's full-sized avatar

TurhanOz TurhanOz

View GitHub Profile
@TurhanOz
TurhanOz / PURE java project, using AndroidStudio IDE
Last active May 28, 2018 10:39
PURE java project, using AndroidStudio IDE
gradle init --type java-application
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Islamophobe - définition & solution</title>
<!-- Bootstrap -->
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
@TurhanOz
TurhanOz / screenrecord.sh
Created December 11, 2016 22:05 — forked from tasomaniac/screenrecord.sh
Screen Record for Android
#!/bin/sh
set -e
if [ -z "$1" ]; then
shot_path=$(date +%Y-%m-%d-%H-%M-%S).mp4
else
shot_path="$*"
fi
@TurhanOz
TurhanOz / Get SUM of counts for an event
Last active December 5, 2019 21:27
BigQuery requests
public static void trackItemsSelectedCount(Context context, int count) {
Bundle bundle = new Bundle();
bundle.putInt("count", count);
getAnalytics(context).logEvent("items_selected", bundle);
}
SELECT
SUM((SELECT params.value.int_value FROM x.params WHERE params.key = 'count')) AS count
FROM package_ANDROID.app_events_20170123, UNNEST(event_dim) AS x
@TurhanOz
TurhanOz / EddystoneBleScanner.java
Last active October 18, 2021 06:31
Eddystone BLE Scan
// Eddystone service UUID
private static final ParcelUuid UID_SERVICE =
ParcelUuid.fromString("0000feaa-0000-1000-8000-00805f9b34fb");
BluetoothManager manager = (BluetoothManager) getSystemService(BLUETOOTH_SERVICE);
BluetoothAdapter adapter = manager.getAdapter();
BluetoothLeScanner scanner = adapter.getBluetoothLeScanner();
ScanFilter beaconFilter = new ScanFilter.Builder()
.setServiceUuid(UID_SERVICE)
@TurhanOz
TurhanOz / test-expected-annotation-limit
Last active August 29, 2015 14:00
Square/Phrase/EnhanceTests
@Test(expected = NullPointerException.class)
public void shouldThrowNullPointerException() throws Exception {
Foo foo = new Foo(null);
foo.bar(null);
}