Skip to content

Instantly share code, notes, and snippets.

View pocmo's full-sized avatar
🚀
Just passing by.

Sebastian Kaspari pocmo

🚀
Just passing by.
View GitHub Profile
You are making a Choose Your Own Adventure story for me to play.
Present a list of choices of Choose Your Own Adventure story genres, and let me choose one or enter my own choice of genre. Wait for my response.
After choosing the genre give a list of themes and wait for a response, or let me choose my own theme.
You will give the story a title. You will begin by describing the character that I am playing, including my character's name, age, and appearance. Choose an unusual or interesting name. Briefly describe the setting and world in which the story begins. Describe a tension, danger, or challenge that I must confront.
You are going to create a story one passage at a time. After each passage you will provide a numbered list of choices and wait for a response. Include one emoji for each choice.
@StefMa
StefMa / FrameworkPlugin.kt
Created November 29, 2019 08:26
Apple Framework publishing via Gradle and the jfrog CLI
class FrameworkPlugin : Plugin<Project> {
override fun apply(project: Project): Unit = with(project) {
val zipFramework = tasks.register("zipFatFramework", Zip::class.java) {
it.dependsOn(tasks.named("releaseFatFramework"))
it.from("$buildDir/fat-framework")
it.archiveFileName.set("SomeFramework.framework.zip")
it.destinationDirectory.set(file("$buildDir/fat-framework-zip"))
}
@zbraniecki
zbraniecki / README.md
Last active May 10, 2017 21:40
Building Fennec for DLC

Intro

Getting DLC support in Fennec requires us to change a couple things about how Gecko retrieves and negotiates locales. In particular, it requires us to introduce a new resource registry specifically designed for localization purposes.

The side effect of that, is that until we finish the transition, we'll have two registries storing resources -

  • Old one called "Chrome Registry"
  • New one called "L10n Registry"

We will only be able to get DLC hooked into the new system, which means that we have to recognize that for the time being,

@nickbutcher
nickbutcher / 1_drawable_ic_hash_io16.xml
Last active June 16, 2020 19:28
Animated Stroke. The google I/O website this year (https://google.com/io) has some funky animated lettering. I especially liked the animated stroke around the letters and wondered how you might implement that on Android. Turns out that AnimatedVectorDrawable makes this very easy! Here's how it looks: https://twitter.com/crafty/status/71077957997…
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016 Google 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
@mikehearn
mikehearn / KotlinDuckTyping.kt
Created December 18, 2015 13:46
Kotlin duck typing / type classing fiddle
class A {
fun shout() = println("go team A!")
}
class B {
fun shout() = println("go team B!")
}
interface Shoutable {
fun shout()
@PaulKinlan
PaulKinlan / getdeviceart.sh
Last active May 26, 2022 11:20
Screen Record for Android
#! /bin/bash
mkdir -p ./backgrounds
function get_google_device_art {
local device=$1
# Get the Google Device backgrounds
curl "https://developer.android.com/distribute/marketing-tools/device-art-resources/$1/port_back.png" > "./backgrounds/$1_port_back.png"
curl "https://developer.android.com/distribute/marketing-tools/device-art-resources/$1/port_fore.png" > "./backgrounds/$1_port_fore.png"
@Noitidart
Noitidart / _ff-addon-snippet-jniScreenshot.js
Last active March 24, 2021 18:33
_ff-addon-snippet-jniScreenshot - Shows how to take a native screenshot and draw it to HTML5 canvas. [jni] [canvas] [jsctypes] [android]
// http://stackoverflow.com/questions/2661536/how-to-programatically-take-a-screenshot-on-android/16109978#16109978
// public Bitmap screenShot(View view) {
// Bitmap bitmap = Bitmap.createBitmap(view.getWidth(),
// view.getHeight(), Config.ARGB_8888);
// Canvas canvas = new Canvas(bitmap);
// view.draw(canvas);
// return bitmap;
// }
@mitchwongho
mitchwongho / Docker
Last active June 26, 2024 07:28
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 16, 2024 13:44
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@romannurik
romannurik / CheatSheet.java
Last active May 16, 2023 13:42
Android helper class for showing cheat sheets (tooltips) for icon-only UI elements on long-press. This is already default platform behavior for icon-only action bar items and tabs. This class provides this behavior for any other such UI element.
/*
* Copyright 2012 Google 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