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
xhcnb / install-kbd-backlight.sh
Created Aug 13, 2016 — forked from stefansundin/install-kbd-backlight.sh
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).
View install-kbd-backlight.sh
#!/bin/sh
# 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 https://gist.githubusercontent.com/stefansundin/7003429/raw/install-kbd-backlight.sh | 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
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
应用的评价链接地址
itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@
改成
itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%d
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.