Skip to content

Instantly share code, notes, and snippets.

Jason Xu xhcnb

Block or report user

Report or block xhcnb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
xhcnb /
Created Aug 13, 2016 — forked from stefansundin/
Script to control keyboard backlight brightness on a Chromebook Pixel running Ubuntu. Includes extra bits like restore old session value on boot, dim keyboard on screen lock, restoring value when resuming from suspend, and so on. Relies on kernel module acpi_call (instructions below).
# This script will install the files below.
# Please look through them first so you know what will happen.
# Install by running this command:
# curl -fL | sh
# Uninstall with:
# sudo rm /opt/kbd-{backlight,lock}.sh /etc/pm/sleep.d/70-kbd-backlight
# rm ~/.config/autostart/kbd-{backlight,lock}.sh.desktop
xhcnb / cast_to
Created Sep 28, 2013
View cast_to
template <typename T, typename T2>
static inline T cast_to(const T2& from)
std::stringstream ss;
T to;
ss << from;
ss >> to;
return to;
View new_gist_file
View Ogg Streamer.c
// ************** oggsteamer.h
#define NUM_BUFFERS 4
#define BUFFER_SIZE 65536
#define BUFFER_MSECS 10
typedef struct {
char *data;
int data_length;
int seek_offset;
You can’t perform that action at this time.