Skip to content

Instantly share code, notes, and snippets.

View sr105's full-sized avatar

Harvey Chapman sr105

View GitHub Profile
@sr105
sr105 / qpropertymodel.cpp
Last active April 2, 2019 05:05
QPropertyModel class for easily turning any QObject-derived subclass with properties into a one-row model.
// QPropertyModel
// - a class for easily turning any QObject-derived subclass with properties into a one-row model
//
// Copyright 2013 - Harvey Chapman <hchapman@3gfp.com>
// Source: https://gist.github.com/sr105/7955969
// License:
// This work is licensed under the Creative Commons Attribution-ShareAlike
// 4.0 International License. To view a copy of this license, visit
// http://creativecommons.org/licenses/by-sa/4.0/deed.en_US.
//
@sr105
sr105 / gist:9253828
Created February 27, 2014 16:40
sources layout
base
rdm git://github.com/sr105/rdm-base (fetch)
rdm git://github.com/sr105/rdm-base (push)
* (no branch) 9471f9e Modify freescale base for RDM and wandboard dual
remotes/m/master -> rdm/master
remotes/rdm/master 9471f9e Modify freescale base for RDM and wandboard dual
meta-fsl-arm
yocto git://git.yoctoproject.org/meta-fsl-arm (fetch)
yocto git://git.yoctoproject.org/meta-fsl-arm (push)
* (no branch) af392c2 gst-fsl-plugin: Activate gstreamer AAC decoder.
Desktop$ hg init TestHg
Desktop$ cd TestHg/
TestHg$ touch A
TestHg$ hg ci -Am "First A"
adding A
TestHg$ mkdir sub1
TestHg$ hg cp A sub1/A
TestHg$ hg ci -Am "sub1 A"
TestHg$ mkdir sub2
TestHg$ hg cp A sub2/A
@sr105
sr105 / gist:9a86ea8709694ab24cef
Created July 9, 2014 18:24
gstreamer1.0-plugins-bad --enable-quicktime configure output
hchapman@mint /oe/tmp/tmp/work/cortexa9hf-vfp-neon-mx6-poky-linux-gnueabi/gstreamer1.0-plugins-bad/1.2.4-r0/gst-plugins-bad-1.2.4 $ cat ../tem
DEBUG: Executing python function sysroot_cleansstate
DEBUG: Python function sysroot_cleansstate finished
DEBUG: SITE files ['endian-little', 'bit-32', 'arm-common', 'common-linux', 'common-glibc', 'arm-linux', 'arm-linux-gnueabi', 'common']
DEBUG: Executing shell function autotools_preconfigure
DEBUG: Shell function autotools_preconfigure finished
DEBUG: Executing python function autotools_copy_aclocals
DEBUG: Python function autotools_copy_aclocals finished
DEBUG: Executing shell function delete_liblink_m4_file
[30] [lab 21064 NP93-2930 4.4.0-cde4 003018134F17] [192.168.25.105] ~
$ dpkg -l | grep linux-image
ii linux-image-3.13.0-34-generic 3.13.0-34.60 i386 Linux kernel image for version 3.13.0 on 32 bit x86 SMP
ii linux-image-extra-3.13.0-34-generic 3.13.0-34.60 i386 Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
ii linux-image-generic 3.13.0.34.40 i386 Generic Linux kernel image
[31] [lab 21064 NP93-2930 4.4.0-cde4 003018134F17] [192.168.25.105] ~
$ uname -r
3.13.0-34-generic
@sr105
sr105 / gist:deee15c0402fa80e49b2
Last active August 29, 2015 14:08
keybase.md
### Keybase proof
I hereby claim:
* I am sr105 on github.
* I am harvey (https://keybase.io/harvey) on keybase.
* I have a public key whose fingerprint is A1BA 4D60 4D34 6A20 7A99 2832 F94E 94DC 000B BDD7
To claim this, I am signing this object:
@sr105
sr105 / PhotoGalleryFragment.java
Created December 6, 2014 22:08
gridview with square cells, look at setupAdapter()
package com.rdm.photogallery;
import java.util.ArrayList;
import android.app.Activity;
import android.app.Fragment;
import android.app.SearchManager;
import android.app.SearchableInfo;
import android.content.ComponentName;
import android.content.Context;
@sr105
sr105 / solution.java
Created December 7, 2014 23:22
send command to UI thread using a message containing the command and a place to put the response. The sender waits for the UI using a CountDownLatch
// In background thread:
Handler uiHandler;
public void test() {
Command command = new Command();
// fill command
Response response = send(command);
}
public Response send(Command command) {
#! /bin/bash
# Description: show dependency tree
# Author: damphat
if [ $# -lt 1 ]; then
echo 'Usage: apt-rdepends-tree [-r] <package>'
echo 'Required packages: apt-rdepends'
exit 1
fi
@sr105
sr105 / gist:1b562519f7cafbf25a14
Last active August 29, 2015 14:12
e-mail about case colisions and revert
From: "Harvey Chapman" <hchapman-hg@3gfp.com>
Subject: revert and remove, filename case collision behavior
Summary:
1. Is "hg revert -a" supposed to give errors for filename case collision? I discovered that since it doesn’t, it makes for a nice way to clean up collisions on case-insensitive filesystems.
2. Also, hg remove acts a little odd when asked to remove a case collision filename. Examples below.
[ There would be an email here but the list server thinks it’s spam no matter how I send it and from where ]