Skip to content

Instantly share code, notes, and snippets.

@tbroyer
tbroyer / ActivityAsyncProxy.java
Created July 3, 2012 10:07
ActivityAsyncProxy
/*
* Copyright 2012 Thomas Broyer <[email protected]>
*
* 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
@rherrmann
rherrmann / GitInternalsLearningTest.java
Last active October 11, 2020 07:11
'Learning Tests' that use the JGit API to explore the internals of Git commits: http://www.codeaffine.com/2014/10/20/git-internals/
/***************************************************************************************************
* Copyright (c) 2014 Rüdiger Herrmann
* All rights reserved. This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
**************************************************************************************************/
package com.codeaffine.jgit;
@bitjockey42
bitjockey42 / Ubuntu 16.04 systemd-boot.md
Last active September 25, 2019 10:07
Ubuntu 16.04 using systemd-boot instead of grubby

You do not need a separate /boot partition unless you have an LVM setup (used in dm-crypt setups).

Run ubiquity -b to open the installer with the option of skipping grub installation (since we're using systemd-boot).

When you get to the screen "Ubuntu has finished installation" choose Continue testing.

Open a Terminal.

Chroot into the new system.

@ruario
ruario / intro-latest-widevine.md
Last active January 29, 2024 07:53
Fetches the latest Linux Widevine binary so that it can be used by Vivaldi.

With the release of Vivaldi 2.2, this page is now obsolete and unmaintained. Widevine is fetched automatically on post install of our official packages. The information below and the script are left for historical reasons but will not be updated.

If you are using something newer than Vivaldi 2.2, you should not be using this script as there is simply no need. Any need you think you have for it would be a bug IMHO and thus should be logged in a bug report. Before you do so however, you should also checkout the Vivaldi help page on Widevine, on Linux


Summary

A bunch of people asked how they could use this script with pure Chromium on Ubuntu. The following is a quick guide. Though I still suggest you at least try Vivaldi. Who knows, you might like it. Worried about proprietary componants? Remember that libwidevinecdm.so is a b

@0chroma
0chroma / VFIO Setup Guide.md
Last active October 21, 2024 15:28
Windows 10 VFIO QEMU Setup

VFIO Setup Guide

I play games regularly, and the sad reality is that it forces me to use Windows on my desktop. There's a Linux installation on there, but rebooting into it is such a massive interruption that I usually just move over to my laptop for programming. Working on a laptop leads to all sorts of ergonomic issues, and it felt like a massive waste to not develop on the desktop hardware I invested so much in. So after extensively researching what the VFIO community has been doing, I've deleted my Windows installation and moved all my gaming into a virtual machine on a Linux host.

Normally VMs are too slow for gaming, but thanks to a feature called VFIO you can run games at near-native performance by passing graphics cards and USB controllers directly to a virtual machine. The only requirement is that your board supports IOMMU, which most modern systems have. In this guide I'll wal

@TG9541
TG9541 / ws2812.fs
Last active September 29, 2023 09:57
STM8 eForth WS2812 LED Strip Demo
\ A STM8 eForth WS2812 demo with tested timing
\ for STM8S w/ 16MHz (HSI) clock
\ 3.3V MINDEV: PB4 with 1K pull-up to 5V works well
\res MCU: STM8S103
\res export PB_DDR PB_ODR PB_CR1
#require ]B!
#require ]CB
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active November 16, 2024 01:37
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@TG9541
TG9541 / BF!.asm
Last active April 25, 2020 10:22
Notes on BF! (version with X as the working register) and BF@ (Little Endian)
; starting from B! ( t a u -- )
; t a u
; 1 $100 7
; bit# Addr Bool
; 00 01 01 00 FF FF
; == --- ===== =====
; 72 1F 01 00 81 FF
; X 1,X 2,X 4,X
@smacharacek
smacharacek / MySqlLiquibaseDatabase.java
Last active October 17, 2023 05:42
Generator for jOOQ for MySql with Liquibase & Testcontainers (with gradle code generation)
package com.example
import liquibase.Contexts;
import liquibase.LabelExpression;
import liquibase.Liquibase;
import liquibase.database.Database;
import liquibase.database.DatabaseFactory;
import liquibase.database.jvm.JdbcConnection;
import liquibase.resource.FileSystemResourceAccessor;
import org.jooq.DSLContext;
@TG9541
TG9541 / W28_IR_RC.md
Last active August 16, 2023 05:06
IR Remote Control for an RGBW LED Bulb with STM8 eForth

STM8 eForth: IR Remote Control for an RGBW LED Bulb

These days IR remote control is still the cheapest option for consumer electronics. I've long had the idea that Forth is ideal for scripting IR remote-controlled devices and I used the light bulb at my desk to learn how to do that with STM8 eForth. LED lamps of relatively high quality with a combination of white LED and RGB LEDs have a remarkable low price tag: the set below costs no more than a regular white LED lamp. In my experience service life is much better (maybe due to a switched mode power supply with constant DC voltage and µC PWM control). The option for occassional colorful illumination is a bonus.

This writeup covers analyzing light bulb IR remote control codes and using it with STM8 eForth . The code below also is a showcase for the expressive power of STM8 eForth on a cheap 8bit µC (e.g., STM8S103F3P6 w/ 8K Flash and 1K RAM).

![image](https://user-images.githubusercontent.com/5466977/10