Skip to content

Instantly share code, notes, and snippets.

View pnkfelix's full-sized avatar
🍩
re-pat; ex-🥐

Felix S Klock II pnkfelix

🍩
re-pat; ex-🥐
View GitHub Profile
@rvagg
rvagg / README.md
Last active August 7, 2024 22:05
Kindleberry "Paperwhite" Pi

Work in progress, I'll write this up properly when I'm done.

Almost all credit goes to @maxogden for putting me on to this and pointing me in the right direction for each of these items.

Prerequisites:

  • Raspberry Pi
  • Kindle Paperwhite freed from its locked down state (jailbroken) http://www.mobileread.com/forums/showthread.php?t=198446
    • You have to downgrade your Kindle to 5.3.1 to install the current jailbreak; that's just a matter of getting the old version image, putting it on your Kindle via USB and telling it to install "upgrade". Then you put in the Jailbreak files, load the ebook and break.
  • Your kindle will be quick to detect an upgrade is available so it'll want to upgrade soon afterwards but the jailbreak will last but you have to reinstall the developer certificates so it's a bit of a pain but doable. Find all the instructions on the mobileread.com forums and wiki.
////////////////////
// in visit.rs:
trait Visitor {
fn visit_item(&mut self, item: @ast::item) { ... }
fn visit_expr(&mut self, expr: @ast::expr) { visit_expr(self, expr); }
...
}
// default implementations:
@nikomatsakis
nikomatsakis / gist:5443789
Created April 23, 2013 14:01
elisp to move diff hunks to another buffer
(defun diff-hunk-move (dest-buffer)
"Move current hunk to another buffer."
(interactive "bBuffer to move to:")
(save-excursion
(let* ((start
(point))
(start-of-file
(ignore-errors
(goto-char start)
(diff-beginning-of-file)
@nikomatsakis
nikomatsakis / gist:5533501
Created May 7, 2013 15:26
Make etags-select invoke visit-tags-table is tags-table-list is empty
commit f4a21a1e16f6e9234dc4930b4a68feb67fafaf1b
Author: Niko Matsakis <[email protected]>
Date: Tue May 7 11:25:56 2013 -0400
query if the tags table is not yet loaded
diff --git a/emacs/etags-select.el b/emacs/etags-select.el
index 751ac18..96bcdb0 100644
--- a/emacs/etags-select.el
+++ b/emacs/etags-select.el
@ilyakatz
ilyakatz / chrubuntu12.04.md
Last active December 17, 2015 05:59
html5 video

Ubuntu 12.04 on Samsung ChromeBook

Prerequisites

  • perform system update
    • if you do it later it will ask for all kind of permissions to override various config files
    • change password for root
      • default password is user

###Fix trackpad sudo apt-get install git

  • perform system update
    • if you do it later it will ask for all kind of permissions to override various config files
    • change password for root
      • default password is user
  • Fix trackpad
  • logout and log back in
@Aatch
Aatch / borrow-example.rs
Last active July 5, 2023 04:22 — forked from kolmodin/rust-json.rs
An example and explanation of how to use lifetimes and borrowing to avoid copying, while maintaining safety.
extern mod extra;
use extra::json::*;
/*
* This function manages to do absolutely no copying, which is pretty cool.
*
* "What are all those `'r`s?" you ask. Well, they're liftime parameters. They
* indicate how long something lasts (before it's freed). They can't change how
* long something lives for, they only allow you to tell the compiler stuff it
@Aatch
Aatch / trait_visitor.rs
Created June 26, 2013 07:41
Visitor impl using a trait & default methods.
#[allow(default_methods)];
extern mod syntax;
use std::os;
use syntax::abi::AbiSet;
use syntax::codemap::span;
use syntax::parse;
use syntax::opt_vec;
@amatus
amatus / rust_for_rpi.md
Last active February 18, 2017 21:13 — forked from anonymous/gist:6664882
Howto build a rust compiler for the Raspberry Pi on Debian 7.1 (wheezy)

Howto build a rust compiler for the Raspberry Pi on Debian 7.1 (wheezy)

sudo apt-get install git build-essential
test `uname -m` = x86_64 && sudo apt-get install ia32-libs
git clone https://github.com/raspberrypi/tools.git
export PATH=$PWD/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:$PATH
git clone http://github.com/mozilla/rust.git
cd rust
./configure --target-triples=arm-unknown-linux-gnueabihf

make

@klutzy
klutzy / hello.rs
Last active April 26, 2016 19:15
Rust with Emscripten
// emscripten uses le32-unknown-nacl triple but rustc doesn't know it now.
// So just use similar target instead.
// `rustc hello.rs --target=i686-unknown-linux --emit-llvm -S --cfg libc`
// `emcc hello.ll -o hello.js`
// no `extern mod`.
#[no_std];
#[feature(macro_rules)];
use core::container::Container;