Skip to content

Instantly share code, notes, and snippets.

@nyet
nyet / plusmute.user.js
Created January 13, 2012 23:19 — forked from antimatter15/plusmute.user.js
Google+ Mute Keyboard Shortcut Userscript
// ==UserScript==
// @name Google+ Mute Keyboard Shortcut
// @namespace http://antimatter15.com/
// @description Mute conversations in your stream by hitting "m"
// @include https://plus.google.com/*
// @include http://plus.google.com/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js
// @version 1.3
// ==/UserScript==
@jgeurts
jgeurts / AndroidAutoIncrementVersion.cs
Created July 17, 2012 20:03
Update android version strings
using System.IO;
using System.Text.RegularExpressions;
namespace AndroidAutoIncrementVersion
{
class Program
{
static void Main(string[] args)
{
try
@kpbird
kpbird / MemoryLimits
Created July 24, 2013 11:34
How to identify memory limits per application in your Android device. This solution require API level 11.
package com.example.androidnative;
import android.app.Activity;
import android.app.ActivityManager;
import android.os.Bundle;
import android.util.Log;
public class MainActivity extends Activity {
@Override
@craig552uk
craig552uk / Chart.html
Created September 28, 2012 13:40
Blog: Google Spreadsheet Powered Interactive
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Chart</title>
<meta charset="utf-8">
</head>
<body>
<p class="my-chart" style="text-align:center"></p>
@tir38
tir38 / build.gradle
Last active October 7, 2016 06:00
How to document your dependency list
dependencies {
compile project(':core')
// Parser for scanRecord byte array returned from
// android.bluetooth.BluetoothAdapter.LeScanCallback.onLeScan()
// This is only needed for pre-Lollipop devices.
// https://github.com/TakahikoKawasaki/nv-bluetooth
// Apache 2.0
compile 'com.neovisionaries:nv-bluetooth:1.7'
<?xml version="1.0" encoding="utf-8"?>
<!-- Add this as a debug manifest so the permissions won't be required by your production app -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
</manifest>
@danybony
danybony / RainbowLightsActivity.java
Created December 28, 2016 23:47
Android Things sample activity showing how to read and toggle some LEDs in response
public class RainbowLightsActivity extends Activity {
private static final String TAG = RainbowLightsActivity.class.getSimpleName();
private List<Gpio> buttons = new ArrayList<>();
private Map<Color, Gpio> leds = new HashMap<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
#!/bin/bash
# Based on https://gist.github.com/johnjohndoe/5398030
checkForAndroidDevice() {
NOT_PRESENT="List of devices attached"
ADB_FOUND=`adb devices | tail -2 | head -1 | cut -f 1 | sed 's/ *$//g'`
if [[ ${ADB_FOUND} == ${NOT_PRESENT} ]]; then
echo "Android device seems to be missing."
@kkuivi
kkuivi / gist:d49d7d832013b2b15e28cf20706a013a
Last active January 17, 2017 15:09
ReferenceMap- Datastructure that makes it possible to pass objects between activities for Android development.
package com.goeshow.barcodescanner.utils.objectReferenceMap;
import android.content.Context;
import android.support.v4.app.Fragment;
import java.util.HashMap;
/**
* Created by ekuivi on 8/24/16.
*
import android.app.Activity;
import android.support.annotation.Nullable;
import android.support.test.runner.lifecycle.ActivityLifecycleMonitorRegistry;
import java.util.Collection;
import static android.support.test.InstrumentationRegistry.getInstrumentation;
import static android.support.test.runner.lifecycle.Stage.RESUMED;
public final class CurrentActivityUtil {