Skip to content

Instantly share code, notes, and snippets.

View nathanjones's full-sized avatar

Nathan Jones nathanjones

View GitHub Profile
@ManueGE
ManueGE / ImagePicker+TOCropViewController.swift
Last active November 6, 2018 20:44
ImagePicker+TOCropViewController
//
// ImagePicker.swift
// manueGE
//
// Created by Manuel García-Estañ on 7/11/16.
// Copyright © 2016 ManueGE. All rights reserved.
//
import Foundation
import UIKit
@IanKeen
IanKeen / Example.swift
Last active July 10, 2019 22:02
Small utility methods to simplify dealing with Reusable items i.e. table/collection view cells
//`UITableViewCell` and `UICollectionViewCell` are `Reusable` by defaut
//Use the extension method to dequeue an instance of the appropriate `Reusable`
class MyVC: UITableViewDataSource {
override func viewDidLoad() {
super.viewDidLoad()
tableView
.registerReusable(FooCell.self)
.registerReusable(BarCell.self)
}
@geekygecko
geekygecko / android.md
Last active October 14, 2022 19:32
Android Cheat Sheet

Android Cheat Sheet

Developer tips

Record a video of your app

Developer options -> Check show touches
adb shell screenrecord /sdcard/video.mp4
adb pull /sdcard/video.mp4
@alana-mullen
alana-mullen / AndroidManifest.xml
Last active August 8, 2018 00:34
Setting up styles.xml and values-v21/styles.xml to use Material Design with AppCompat. Rename styles21.xml as styles.xml and place in your res/values-v21 folder (you may need to create a values-v21 folder if you don't already have one).
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="uk.co.thewirelessguy.myappname" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
@jacobmoncur
jacobmoncur / gist:8587185
Created January 23, 2014 21:28
Gradle file for getting maven dependencies hosted on private github repo
repositories {
mavenCentral()
maven {
url = 'https://github.com/github-username/github-project/raw/master'
credentials {
username 'my-username'
password 'my-password'
}
}
}
@cr3ative
cr3ative / gist:8337446
Last active December 8, 2022 08:16
Drift HD Ghost WiFi Application API

Drift HD Ghost WiFi Application API

See my technical notes here, which include how to get root on a Drift HD Ghost with no modifications to the unit.

The following is a list of URLs which might be handy if you connect your machine to the Drift HD Ghost's WiFi network.

Live Video URL (works great in VLC)

rtsp://192.168.42.1/AmbaStreamTest
@artem-zinnatullin
artem-zinnatullin / MyApp.java
Last active January 15, 2023 13:04
If you need to set one font for all TextViews in android application you can use this solution. It will override ALL TextView's typefaces, includes action bar and other standard components, but EditText's password font won't be overriden.
public class MyApp extends Application {
@Override
public void onCreate() {
TypefaceUtil.overrideFont(getApplicationContext(), "SERIF", "fonts/Roboto-Regular.ttf"); // font from assets: "assets/fonts/Roboto-Regular.ttf
}
}
// more information here: http://blog.tomtasche.at/2012/10/use-built-in-feedback-mechanism-on.html
try {
int i = 3 / 0;
} catch (Exception e) {
ApplicationErrorReport report = new ApplicationErrorReport();
report.packageName = report.processName = getApplication()
.getPackageName();
report.time = System.currentTimeMillis();
report.type = ApplicationErrorReport.TYPE_CRASH;
@hyle
hyle / ko.utils.2.3.0.signatures.js
Last active September 25, 2018 09:11
KnockoutJS 2.3.0 utils (ko.utils) signatures
// knockout 2.3.0
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
@swankjesse
swankjesse / RetrofitCachingExample.java
Created June 29, 2013 03:03
Demonstrate HTTP caching with OkHttp and Retrofit.
/*
* Copyright (C) 2013 Square, Inc.
*
* 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