Skip to content

Instantly share code, notes, and snippets.

View rixth's full-sized avatar

Thomas Rix rixth

View GitHub Profile

Keybase proof

I hereby claim:

  • I am rixth on github.
  • I am rx (https://keybase.io/rx) on keybase.
  • I have a public key whose fingerprint is 9B8A CD4E 5785 8CD2 37EE 02FA C275 04E0 7119 F00D

To claim this, I am signing this object:

const LONG_PRESS_MS = 400,
LONG_PRESS_TOLERANCE = 20,
NUDGE_MS = 400,
NUDGE_THRESHOLD = 20,
SWIPE_THRESHOLD = 70;
function Touchable() {
this.after('initialize', function () {
let touches = [],
// Enable GPIOB & TIM3 clocks
__HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_TIM3_CLK_ENABLE();
// Set up GPIOB1 (timer 3, channel 4) in alternate function (AF) mode
GPIO_InitTypeDef GPIO_InitStruct;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
GPIO_InitStruct.Pin = GPIO_PIN_1;
@rixth
rixth / mco1.cpp
Last active August 29, 2015 14:25
// Start the MCO outputing the main system clock
HAL_RCC_MCOConfig(RCC_MCO, RCC_MCO1SOURCE_SYSCLK, RCC_MCODIV_1);
# File you want to get before it's deleted
fileToSave = 'blarblarblar'
# If you want to specify a little bit we can trim off the end
# do it here in bytes. This may make the script more likely to
# save your file.
buffer = 0;
# Wait for the file to be created
print "Okay, please start the process that outputs "+fileToSave+"\n";
while true
#!/usr/bin/ruby
# Search a users previous 3200 for a keyword.
unless ARGV.size == 2
puts "USAGE: look-for-tweet.rb username terms"
Process.exit
end
username = ARGV.first
Index: cmsworkflow/code/ThreeStep/SiteConfigThreeStepWorkflow.php
===================================================================
--- cmsworkflow/code/ThreeStep/SiteConfigThreeStepWorkflow.php (revision 97653)
+++ cmsworkflow/code/ThreeStep/SiteConfigThreeStepWorkflow.php (working copy)
@@ -128,6 +128,7 @@
*/
public function canPublish($member = null) {
if(!$member && $member !== FALSE) $member = Member::currentUser();
+ if (is_numeric($member)) $member = DataObject::get_by_id('Member', $member);
var meryl = require('./vendor/meryl');
meryl.h('GET /hello/{a}/{b}/{c}', function () {
this.send(this.params.a + this.params.b + this.params.c);
});
require('http').createServer(meryl.cgi()).listen(3000);
var C = twttr.constants.noob;
B = B || twttr.currentUser;
if (B && twttr.decider.isAvailable("flock")) {
if (B.statusesCount == 0) {
if (B.followersCount > 49) {
return C.notNoob
}
if (B.friendsCount === 0) {
return (B.followersCount ? C.invited : C.total)
} else {
@rixth
rixth / by.js
Created February 3, 2011 18:11 — forked from nonowarn/by.js
(function (win, doc) {
var by = {},
slice = [].slice,
type2method = {
id: "getElementById",
className: "getElementsByClassName",
tagName: "getElementsByTagName",
query: "querySelectorAll"
};