Skip to content

Instantly share code, notes, and snippets.

@JakeWharton
JakeWharton / AutoGson.java
Last active November 28, 2021 12:32
A Gson TypeAdapterFactory which allows serialization of @autovalue types. Apache 2 licensed.
import com.google.auto.value.AutoValue;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Marks an {@link AutoValue @AutoValue}-annotated type for proper Gson serialization.
* <p>
@grantslatton
grantslatton / hngen.py
Last active September 27, 2021 11:07
A program that uses Markov chains to generate probabilistic Hacker News titles.
import urllib2
import re
import sys
from collections import defaultdict
from random import random
"""
PLEASE DO NOT RUN THIS QUOTED CODE FOR THE SAKE OF daemonology's SERVER, IT IS
NOT MY SERVER AND I FEEL BAD FOR ABUSING IT. JUST GET THE RESULTS OF THE
CRAWL HERE: http://pastebin.com/raw.php?i=nqpsnTtW AND SAVE THEM TO "archive.txt"
@zhuowei
zhuowei / kernel_changelog_tidbits.md
Last active December 19, 2015 10:59
Glass Kernel Changelog Tidbits

Kernel Changelog Tidbits for Glass

I've always enjoyed teardowns of of the software in new products. As you can expect, I loved the detailed writeup of the secrets found in Google Glass's kernel source at http://thecodeartist.blogspot.ca/2013/05/sensors-on-google-glass.html . However, when that article is written, the source code of the kernel was just served without the changelog (provided by their version control system, Git). Since then, Google had released the kernel with full change information on AOSP.

If you want to dig around the logs yourself: https://android.googlesource.com/kernel/omap/+log/glass-omap-xrr88/ with highlights at https://android.googlesource.com/kernel/omap/+log/glass-omap-xrr88/arch/arm/mach-omap2/board-notle.c and https://android.googlesource.com/kernel/omap/+log/glass-omap-xrr88/arch/arm/mach-omap2/notle-usb-mux.c . More eyes will probably uncover more secrets.

@zhuowei
zhuowei / glassxe7_teardown.md
Last active December 19, 2015 08:59
What's Really New: Glass XE7

Google Glass XE7 was released this week. This time, Google also released a changelog of all the changes. However, I'm a reader of Ron Amadeo's APK Teardown series, and that column taught me to always hunt for hidden changes in updates.

So without further ado, I present:

#What's Really New: Glass XE7

Volume change

@zhuowei
zhuowei / glasslabs.md
Last active December 17, 2015 14:29
Glass Labs experiments: what they do

Glass Lab Experiments

Updated: July 2nd (XE7)

Ron Amadeo of Android Police did a review of these experiments: http://www.androidpolice.com/2013/05/24/google-glasss-hidden-labs-features-ok-glass-everywhere-web-browsing-video-stabilization-and-more-video/

Google Glass has a series of Labs experiments that can be enabled on engineering or userdebug builds. Using APKTool, I've removed that restriction and now they can be enabled with root access.

To start, for example, the SOUND_SEARCH lab, type in a root shell

@thirteen37
thirteen37 / pixel-arch.md
Last active June 6, 2020 07:47
Installing Arch on the Chromebook Pixel

This describes my basic Arch Linux installation on my Chromebook Pixel.

Note: I'm a coward, so I installed Arch to an SD card instead of wiping out the existing SSD.

Requirements

  • SD card. A very minimal Arch installation with XFCE will need about 2GB, so I think 4GB is the minimum you can get by with.
  • Arch installer on a USB drive. The 2013.05.01 is broken with the recent netctl change. So either get an older or newer one.
  • Some Arch Linux familiarity.
  • Time, patience, and good eyesight.
@jordanorelli
jordanorelli / fuck_time_warner.md
Last active June 3, 2019 14:14
Fuck you, Time Warner Cable

I missed a payment on my Time Warner Cable bill. Prior to this, the hostname of my laptop was "yupa" (after Master Yupa, from Nausicaa of the Valley of the Wind, because it's a MBA, get it, air? ok, sorry, that's fucking awful I know). Anyway, look at what my hostname is now:

jordanorelli@auto-prov[0] ~: hostname
auto-prov.rr.com

umm, excuse me, I never changed my hostname. Anyway, let's back the fuck up and see how I even discovered this.

When I got home today, I opened my MBA and fired up Chrome. On startup, it tried to open up all the tabs that were open when I closed it. Some of these included a google.com page. All of them were, instead, redirected to whatever hostname they were talking to, with ap_index tacked on the end. E.g., refreshing a Google page bounced me to google.com/ap_index, which is the automatic provisioning page that a Time Warner Cable tech is supposed to see when they start up the computer. My brother (who is also my roommate) opened the account and has all the i

@briandoll
briandoll / A_toast_to_you.md
Last active March 19, 2022 01:17
Toasts! - scripts to convert images attached to GitHub issues into an animated gif for serious celebratory purposes

To toast:

  • Make sure you have ImageMagick installed (brew install imagemagick)
  • Change line 7 of toast.rb to the repository name you're working with
  • toast!
$ bundle install
$ ./get_token [user] [pass]
$ export GHUSER=[myuser]
@ryankearney
ryankearney / ComcastInject.html
Last active June 10, 2023 14:40
This is the code Comcast is injecting into its users web traffic.
<script language="JavaScript" type="text/javascript">
// Comcast Cable Communications, LLC Proprietary. Copyright 2012.
// Intended use is to display browser notifications for critical and time sensitive alerts.
var SYS_URL='/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/notify.do';
// var image_url='http://servicealerts.comcast.net:8080/images/mt';
var image_url='http://xfinity.comcast.net/constantguard/BotAssistance/notice/images';
var headertext1='<strong>Comcast Courtesy Notice</strong>';
var textline1='You have reached 90% of your <b>monthly data usage allowance</b>.';
var textline2='Please sign in for more information and to remove this alert.';
var acknowledgebutton='<a href=\"#\" onClick="document.location.href=\''+SYS_URL+'?dispatch=redirect&redirectName=login&paramName=bmUid\'" title="Sign in to acknowledge" style="color: #FFFFFF;"><img alt="Sign in to acknowledge" src="'+image_url+'/mt_signin.png"/></a>';
@Nurdok
Nurdok / python_conversion.md
Last active July 11, 2024 15:00
Python Conversion

Python Number Conversion Chart

From To Expression