Categories
Projects Raspberry Pi

Raspberry Pi, touch screen, and a bluetooth speaker

A really simple project that delivers!

Includes:

The only ‘gotcha’ I came across was when sending audio to the Bluetooth speaker, the emulator I was using (snes9x, the default) got super choppy. This was resolved by adding pisnes as an emulator to EmulationStation and using it instead.

 

Categories
News

Certbot makes SSL certs laughably easy

SSL is in the house! Certbot makes it trivial: https://certbot.eff.org/

Categories
Scripts

I bookmark. A lot.

I’ve been working on a Python script to help me parse (and make sense) of all the bookmarks I consume on a daily basis. I was interested in just how many I accumulate daily, monthly, and yearly. It turns out, a lot.Output

Categories
Arduino Coding Projects Scripts Video

Destroying the web with a plasma ball

I plan to do a more thorough write-up on my plasma-ball project, but for now here’s the video, some pictures, and a link to the repo.

Github: https://github.com/twstokes/arduino-plasma-ball

It made Boing Boing – woot!

Categories
Coding

3D Touch force values in Swift

We’re going to see really cool stuff from this. I was curious if 3D Touch in the new iOS devices provided continuous values, or a few discreet ones (light press, semi press, hard press).

Excitingly, you get a nice float back.

Who’s going to be the first to react to users squeezing their phones in a rage? #canfinallyhitstuffharder

Force touch


import UIKit

class ViewController: UIViewController {

    //@IBOutlet weak var buttonOutlet: UIButton!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    override func touchesMoved(touches: Set, withEvent event: UIEvent?) {
        let touch = touches.first!
        let force = touch.force.description
        print(force)
    }

}
Categories
Projects Raspberry Pi

Raspberry Pi Touchscreen LEGO Stand

I recently acquired a couple of the awesome 7″ Raspberry Pi touch screens. They’re great except for one thing – how the heck do you hold it up out of the box?

Some third party manufacturers are selling stands, but can dirt-cheap LEGOs accomplish the same thing? Of course. I cooked this up in a few minutes. Three points support the screen perfectly, and a piece is added behind the USB ports to minimize sliding (though that hasn’t been an issue at all).

A downside to this design is that two USB ports are blocked on this model, but you may not need them at all as in my case.

Categories
Projects Technology

The Mac Pro gets an SSD part 2!

Welp, that didn’t take long. After installing my new SSD I quickly realized I could do better. Upgrading to SATA III from SATA II for less than $60 was a no-brainer.

Installation couldn’t be simpler either: All I had to do was attach the SSD onto the onboard slot and install the PCIe card. After powering on it booted right up, nothing else required.

Categories
Projects Technology

The Mac Pro gets an SSD

Six years old, and now running even better: The Mac Pro gets a Samsung 850 Pro 512GB SSD housed in an Icy Dock enclosure.

In hindsight I probably should’ve looked into a PCIe SSD to get higher speeds since my 2009 Nehalem machine has only SATA 2.0. Regardless, I’m loving the boost.

Edit: SATA 3 drive controller ordered!

Categories
Coding Projects Web

Responsive Design with Adaptive Images

Today I got curious if I could solve the issue of high-res images being loaded on small screens with responsive design. Here’s my solution via jQuery plugin.

Basically, I’m detecting the max size of the image by looking at its parent container and comparing that with the grid breakpoints. In my example I used Bootstrap, but I don’t see why any other responsive framework wouldn’t work.

Github

Categories
Coding Projects

Emoji URLs

I got curious if one could construct emoji URLs…

Emoji_URL

.htaccess

RewriteEngine On
RewriteRule (.+) index.php?request=$1 [L,QSA]

index.php

$requestArray = explode("/", $_GET['request']);

echo “Welcome to my page about “;

if(urlencode($requestArray[0]) == ‘%F0%9F%90%A8’) echo ‘koalas’;

echo ‘ eating ‘;

if(urlencode($requestArray[1]) == ‘%F0%9F%8D%94’) echo “burgers!\n”;