Skip to content

Instantly share code, notes, and snippets.

View drudge's full-sized avatar

Nicholas Penree drudge

View GitHub Profile
@drudge
drudge / animated-render.star.py
Last active December 31, 2021 01:25
Xbox Live Gamerscore Custom Pixlet
# Tidbyt Xbox Live App
# MIT License
# by Nicholas Penree, Dec 19 2021
load("render.star", "render")
load("http.star", "http")
load("encoding/base64.star", "base64")
load("cache.star", "cache")
MOCK = False
@drudge
drudge / ip.star.py
Last active December 29, 2021 04:50
Public IP Address Applet for Tidbyt
# Public IP Tidbyt App
# MIT License
# by Nicholas Penree, Dec 28 2021
load("render.star", "render")
load("http.star", "http")
load("cache.star", "cache")
IPIFY_JSON_URL = "https://api.ipify.org/?format=json"
MOCK = False
@rohansingh
rohansingh / README.md
Created April 5, 2021 13:26
Tidbyt LED matrix pinout

These pinouts are formatted for use with SmartMatrix, but the pin numbers will work for any library.

@tuxuser
tuxuser / xbl_oauth2.py
Created September 2, 2020 09:15
Sign in to Xbox Live with OAUTH2
"""
Sign in to Xbox Live with OAUTH2
1. Go to https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade
2. Register new app ("+ New registration")
2.1. Enter a name for your app
2.2. Set "Supported account types" to "Personal Microsoft accounts only"
2.3. Click register
2.4. Choose "Redirect URIs" -> "Add a Redirect URI"
2.5. Click "Add a platform" -> "Mobile and desktop applications"
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
// more information here: http://blog.tomtasche.at/2012/10/use-built-in-feedback-mechanism-on.html
try {
int i = 3 / 0;
} catch (Exception e) {
ApplicationErrorReport report = new ApplicationErrorReport();
report.packageName = report.processName = getApplication()
.getPackageName();
report.time = System.currentTimeMillis();
report.type = ApplicationErrorReport.TYPE_CRASH;
@drudge
drudge / chartkick.jade
Last active December 21, 2015 03:58
Chartkick mixins for Jade
//
// chartkick.jade
// Copyright(c) 2013 Nicholas Penree <[email protected]
// MIT Licensed
//
mixin pie_chart(data_source, options)
+chartkick_cart('PieChart', attributes, data_source, options)
mixin area_chart(data_source, options)
@iheanyi
iheanyi / NowArrayAdapter.java
Last active February 10, 2019 17:32
Google Now Cards Layout XML. list_item.xml can be customized to your heart's content . . . Also, you can implement the following with DragSortListView for swiping to delete, reordering, and whatnot.
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
@slightfoot
slightfoot / HttpDigestAuth.java
Last active May 11, 2023 05:56
HTTP Digest Auth for Android (incomplete and probably hackable, but works!)
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import com.google.common.base.CharMatcher;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
@TomV
TomV / models.user.js
Created May 19, 2013 03:54
Example of using jake-lcm to define locomotive environment for testing a model
/* in the test/ folder of a locomotive app that is using jake-lcm */
var mocha = require('mocha')
, should = require('should')
, lcm = require('jake-lcm')
, User;
/* Assume there is a model in app/models/user.js with
var userSchema = new Schema({
display_name: { type: String, required: true, index: true , trim: true}
, email: { type: String, required: true, trim: true}