Skip to content

Instantly share code, notes, and snippets.

View charroch's full-sized avatar
🏠
Working from home

Carl-Gustaf Harroch charroch

🏠
Working from home
View GitHub Profile
package com.hubstep;
import android.accounts.*;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
local/acroread 9.5.1-2
local/adobe-air 2.1-1
local/adobe-air-sdk 2.6-2
local/android-udev 1.2-1
local/arduino 1:1.0.1-1
local/aspectj 1.6.12-1
local/cairo-cleartype 1.12.2-1
local/cdm-git 20120605-1
local/coffee-script 1.3.3-1
local/dfu-programmer 0.5.4-1
@charroch
charroch / Foo.java
Last active December 10, 2015 20:18
Vogar new run
package foo;
public class Foo {
public int test() { return 0; }
}
@charroch
charroch / gist:5421998
Created April 19, 2013 17:55
ABS gradle
task wrapper(type: Wrapper) {
gradleVersion = '1.3'
}
buildscript {
repositories {
mavenCentral()
}
AuthenticatorDescription[] types = manager.getAuthenticatorTypes();
for (AuthenticatorDescription descriptor : types) {
if ("<package>".equals(descriptor.type)) {
return "<package>.authenticator".equals(descriptor.packageName);
}
}
@charroch
charroch / 0_reuse_code.js
Created September 28, 2013 09:29
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
u0_a62    21074 180   883768 39732 ffffffff 00000000 S com.google.android.music:main
u0_a40    21118 180   878136 38236 ffffffff 00000000 S com.google.android.gallery3d
u0_a61    21148 180   869508 33664 ffffffff 00000000 S com.google.android.apps.uploader
u0_i11    21164 180   947968 55396 ffffffff 00000000 S com.android.chrome:sandboxed_process11
u0_a73    21172 180   904332 41860 ffffffff 00000000 S com.google.android.youtube
shell     21263 198   928    456   c010aba4 b6f3b110 S /system/bin/sh
shell     21271 21263 1236   240   00000000 b6e9b2c8 R ps
u0_a232   21362 180   970604 124664 ffffffff 00000000 S org.zwanoo.android.speedtest
u0_a15    21459 180   938468 60580 ffffffff 00000000 S com.android.vending
root      23212 2     0      0     ffffffff 00000000 S loop9
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.+'
}
class NewUserActivity {
void onClick(TextView view) {
ContentValues values = new ContentValues(1);
String name = view.getText().toString();
Context context = getContext();
ContentResolver resolver = context.getContentResolver();
Uri uri = Uri.parse("content://myuser/");
resolver.insert(uri, values);
}
}