Skip to content

Instantly share code, notes, and snippets.

View sftsk's full-sized avatar

Lukas Jakob Hafner sftsk

View GitHub Profile
@neomantra
neomantra / thing-o-matic-command-line-update.md
Created January 14, 2014 04:30
Thing-o-matic Firmware Upgrade from command-line. Using the ReplicatorG and MakerWare I was getting errors like "upload failed".... and endlessly pressing reset and upload. This worked without any tricky timing. I did this on OSX, but I don't know why it wouldn't work similarly on another OS...

After spending two hours fucking with pushing my reset-button and clicking upload in both ReplicatorG and Makerware, I figured out how to do it from the command line. The command line was determined from running ReplicatorG on the console and trying to upgrade the firmware.

Install ReplicatorG

Download and install it from http://www.makerbot.com/sailfish/install/

Get the 4.4 firmware from Makerbot

wget http://firmware.makerbot.com/firmware/MB-mb24-2560-Sailfish-v4.4-r1029.hex
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@gpbmike
gpbmike / Streamer.php
Created July 6, 2011 21:08
php backend for streaming file upload with XMLHttpRequest
<?php
class File_Streamer
{
private $_fileName;
private $_contentLength;
private $_destination;
public function __construct()
{
if (!isset($_SERVER['HTTP_X_FILE_NAME'])