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
@charroch
charroch / pubsub_emulator.ts
Created July 25, 2019 14:58
Poor man pubsub firebase function emulator
import { PubSub } from '@google-cloud/pubsub'
import * as a from './index'
import { CloudFunction } from 'firebase-functions'
import { Message } from '@google-cloud/pubsub'
import * as dotenv from 'dotenv'
dotenv.config()
const pubsub = new PubSub({
projectId: process.env.GCLOUD_PROJECT
})
@charroch
charroch / fonts
Last active October 9, 2017 08:58
adobe-source-code-pro-fonts oto-fonts otf-fira-mono otf-fira-sans otf-font-awesome powerline-fonts terminus-font ttf-bookerly ttf-dejavu ttf-droid ttf-fira-mono ttf-liberation ttf-monaco ttf-ms-fonts ttf-symbola

Keybase proof

I hereby claim:

  • I am charroch on github.
  • I am charroch (https://keybase.io/charroch) on keybase.
  • I have a public key whose fingerprint is 53D1 9857 9052 FB51 6925 2D05 96C9 3BA9 625A BE22

To claim this, I am signing this object:

@charroch
charroch / adb-cl.sh
Created April 9, 2015 15:15
Get the current running command line
adb shell cat /proc/$(adb shell ps | grep app_process | awk '{print $2}')/cmdline | strings
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);
}
}
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.+'
}
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
@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
AuthenticatorDescription[] types = manager.getAuthenticatorTypes();
for (AuthenticatorDescription descriptor : types) {
if ("<package>".equals(descriptor.type)) {
return "<package>.authenticator".equals(descriptor.packageName);
}
}