This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Handles proper use of Meld from Git. | |
# | |
# Instead of launching meld with $MERGED as the base revision, this | |
# script makes a copy of $BASE and handles copying the result back | |
# to $MERGED if the result was saved. | |
# As an extra tweak, it also presents branch names (if known) as | |
# the file name prefix, instead of just "LOCAL" and "REMOTE". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.bitgrind.control; | |
public class PID { | |
/** | |
* Low pass filter cutoff frequency for the derivative term. | |
*/ | |
private static final int LOWPASS_CUTOFF_HZ = 20; | |
private static final double RC = 1 / (2 * Math.PI * LOWPASS_CUTOFF_HZ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ADB="/home/mrenouf/bin/adb" | |
# We need root on the host to mess with networking | |
if [[ $(whoami) != "root" ]]; then | |
echo "You must be root to run this script!" | |
exit 1 | |
fi; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Handles call to adb and prompts for device selection if | |
# necessary when more than once device is connected. | |
# | |
# by Mark Renouf <[email protected]> | |
# To install: | |
# 1. Place this script somewhere in your path, and make it executable. | |
# 2. Make sure 'adb' is also in your path. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.bitgrind.android.guice; | |
import com.google.common.base.Throwables; | |
import com.google.inject.Binder; | |
import com.google.inject.Guice; | |
import com.google.inject.Injector; | |
import com.google.inject.Module; | |
import com.google.inject.util.Modules; | |
import android.app.Application; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
els = document.getElementsByTagName('li'); | |
for(i = 0; i < els.length; i++) { | |
els[i].addEventListener('click', | |
function() { | |
alert(i); | |
}, | |
false); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <util/delay.h> | |
#include <avr/sleep.h> | |
#include <avr/power.h> | |
#include <avr/io.h> | |
#include <avr/interrupt.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include "port_macros.h" | |
#include "teensy_20.h" | |
#include "cpu_clock.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* <p>ScrollabilityCache holds various fields used by a View when scrolling | |
* is supported. This avoids keeping too many unused fields in most | |
* instances of View.</p> | |
*/ | |
private static class ScrollabilityCache implements Runnable { | |
/** | |
* Scrollbars are not visible | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Manually render this view (and all of its children) to the given Canvas. | |
* The view must have already done a full layout before this function is | |
* called. When implementing a view, implement | |
* {@link #onDraw(android.graphics.Canvas)} instead of overriding this method. | |
* If you do need to override this method, call the superclass version. | |
* | |
* @param canvas The Canvas to which the View is rendered. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* {@inheritDoc} | |
*/ | |
@Override | |
public boolean dispatchTouchEvent(MotionEvent ev) { | |
if (mInputEventConsistencyVerifier != null) { | |
mInputEventConsistencyVerifier.onTouchEvent(ev, 1); | |
} | |
boolean handled = false; | |
if (onFilterTouchEventForSecurity(ev)) { |