Skip to content

Instantly share code, notes, and snippets.

View rileyrg's full-sized avatar
💭
Emacs can replace PHPStorm

RichieHH rileyrg

💭
Emacs can replace PHPStorm
  • Hamburg, Germany
View GitHub Profile
@rileyrg
rileyrg / build.gradle
Created April 8, 2014 11:50
Upload to mavenLocal() (added to repos in parent) the simple way.
apply plugin: 'maven'
group = 'net.richardriley'
archivesBaseName = 'testlib'
version = '0.1'
@rileyrg
rileyrg / build.gradle
Created May 1, 2014 10:42
loadVersion : how?
ext.versionFile = file('version.properties')
task wrapper(type:Wrapper){
gradleVersion="1.10"
}
task loadVersion {
project.version = readVersion()
println project.version
@rileyrg
rileyrg / gist:c8cf90db04a8d7b90dc1
Created July 30, 2014 11:16
using interfaces for callback
Create an interface to describe the "callbacks" available on my main activity so that a worker thread can callback and have the activity update certain mainthread views.
,----
| public interface HoneyBeezListener {
| public void frameRate(int frameCount);
| /* add other callbacks here */
| }
`----
In my customview create a holder for the callback interface and a setter
@rileyrg
rileyrg / gist:342a02d5b569bc8a6f5c
Created August 18, 2014 15:28
First view adaptor
public class DisplayDebug {
private LinkedHashMap<String, String> debugMap = new LinkedHashMap();
public void put(String var, String val) {
debugMap.put(var, val);
}
public DisplayDebug(Activity activity) {
ListView listview = (ListView) activity.findViewById(R.id.debugview);
DebugAdaptor adapter = new DebugAdaptor(activity, debugMap);
gist-region-or-buffer)
(global-set-key (kbd "C-c f")
(lambda ()
(interactive)
(require 'finder)
(let ((thing (intern (thing-at-point 'symbol))))
(if (functionp thing)
(find-function thing)
(find-variable thing)))))
(which-function-mode t)
(add-hook 'after-init-hook 'global-flycheck-mode)
;; (setq flycheck-check-syntax-automatically '(mode-enabled idle-change))
;; (require 'flycheck-color-mode-line)
;; (eval-after-load "flycheck"
;; '(add-hook 'flycheck-mode-hook 'flycheck-color-mode-line-mode))
(global-set-key (kbd "<f11>") 'next-error)
#!/bin/bash
mountpoint="${1-/media/debianbackup}"
sudo mount "${mountpoint}"
mount | grep "${mountpoint}" >/dev/null
if [ "$?" -eq 0 ]
then
sudo rsync -aAXv /* "${1-"${mountpoint}"}" --exclude={"${HOME}"/.cache,/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,"${mountpoint}",/media/cdrom0,/lost+found} --delete
echo "Unmounting "${mountpoint}""
sudo umount "${mountpoint}"
else
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/rgr/.ssh/id_rsa (0x7fc8444e20d0),
debug2: key: /home/rgr/.ssh/id_dsa ((nil)),
debug2: key: /home/rgr/.ssh/id_ecdsa ((nil)),
the fragment layout XML R.layout.debug_fragment
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/debug_listview"
android:layout_width="128sp"
android:background="@color/shadedblack"
android:layout_height="wrap_content">
</ListView>
fragment in a framelayout