Skip to content

Instantly share code, notes, and snippets.

View pjjw's full-sized avatar

peter woodman pjjw

View GitHub Profile
@halomakes
halomakes / _DSC1304.JPG
Last active July 19, 2023 18:43
AirGradient Pro ESPHome Configuration
_DSC1304.JPG
@akihikodaki
akihikodaki / README.en.md
Last active May 11, 2024 02:14
Linux Desktop on Apple Silicon in Practice

Linux Desktop on Apple Silicon in Practice

I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon.

Fortunately, Linux already works on Apple Silicon/M1. But how practical is it?

  • Two native ports exist.
@Schemetrical
Schemetrical / The_Jaunt.md
Last active May 19, 2024 22:19
The Jaunt by Stephen King

Chapter 1

"This is the last call for Jaunt-701," the pleasant female voice echoed through the Blue Concourse of New York's Port Authority Terminal. The PAT had not changed much in the last three hundred years or so - it was still gungy and a little frightening. The automated female voice was probably the most plesant thing about it. "This is Jaunt Service to Whitehead City, Mars," the voice continued. "All ticketed passengers should now be in the Blue Concourse sleep lounge. Make sure your validation papers are in order. Thank you."The upstairs lounge was not at all grungy. It was wall-to-wall carpeted in oyster gray. The walls were an eggshell white and hung with plesant nonrepresentational prints. A steady, soothing progression of colors met and swirled on the ceiling. There were one hundred couches in the large room, neatly spaced in rows of ten. Five Jaunt attendants circulate, speakingin low, cherry voices and offering glasses of milk. At one side of the room was the entranceway, flanked by armed guar

@tornewuff
tornewuff / subl
Created January 16, 2013 00:28
Script to wrap Sublime Text 2 on Linux, handling proper background invocation and using rmate to edit remotely when not in an X session (the guess being that if there's no DISPLAY we are connected via ssh).
#!/bin/bash
if [ -z "$DISPLAY" ]; then
exec rmate "$@"
fi
for arg do
case $arg in
"-w" | "--wait") NEED_FOREGROUND=1;;
"-h" | "--help") NEED_FOREGROUND=1;;
@natduca
natduca / gist:1108568
Created July 27, 2011 03:00
Break into pdb on unittest assertion error
import unittest, exceptions, pdb
class PDBAssertionError(exceptions.AssertionError):
def __init__(self, *args):
exceptions.AssertionError.__init__(self, *args)
print "Assertion failed, entering PDB..."
if hasattr(sys, '_getframe'):
pdb.Pdb().set_trace(sys._getframe().f_back.f_back)
else:
pdb.set_trace()
unittest.TestCase.failureException = PDBAssertionError
@kamermans
kamermans / install-hiphop-fresh.sh
Created July 12, 2011 16:46
Script for installing and compiling HipHop for PHP on a fresh install of Ubuntu 11.04 x64
#!/bin/bash
# HipHop for PHP scripted installation
# by Steve Kamerman, July 12, 2011
echo -e "\e[00;31m**** Installing Prerequisites\e[00m"
sudo apt-get --yes install git-core cmake g++ libboost-dev libmysqlclient-dev libxml2-dev libmcrypt-dev libicu-dev openssl binutils-dev libcap-dev libgd2-xpm-dev zlib1g-dev libtbb-dev libonig-dev libpcre3-dev autoconf libtool libcurl4-openssl-dev libboost-system-dev libboost-program-options-dev libboost-filesystem-dev wget memcached libreadline-dev libncurses-dev libmemcached-dev libicu-dev libbz2-dev libc-client2007e-dev php5-mcrypt php5-imagick libgoogle-perftools-dev
echo -e "\e[00;31m**** Getting HIPHOP in 5 seconds ****\e[00m"

Rails 2.3.11 on App Engine (DataMapper)

Do not use rvm (or install and run from JRuby). The google-appengine gem must install into your system MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.

We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.x calls to rubygems, and now we have it working. Rails 2.3.x currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

See the TInyDS version also: gist.github.com/gists/269075

Install the Development Environment