Skip to content

Instantly share code, notes, and snippets.

View at15's full-sized avatar
🐶
Eating

Pinglei Guo at15

🐶
Eating
View GitHub Profile
@at15
at15 / tidb-talent-plan.en.md
Last active December 30, 2019 05:17
TiDB talent plan (Unofficial English version)

TiDB talent plan

This is an unofficial translation for https://university.pingcap.com/talent-plan/

TL;DR Rust Go

The course has both online and offline parts, however since you are reading the english version, you are likely not going to attend the one month offline part (in China).

Sign up

@at15
at15 / kairosdb.cql
Created September 15, 2017 07:15
Kairosdb Cassandra schema
CREATE TABLE IF NOT EXISTS data_points (
key blob,
column1 blob,
value blob,
PRIMARY KEY ((key), column1)
) WITH COMPACT STORAGE;
CREATE TABLE IF NOT EXISTS row_key_index (
key blob,
column1 blob,
value blob,
@at15
at15 / xephon-k-naive.cql
Last active September 15, 2017 07:13
Cassandra schema for time series data (naive version)
CREATE TABLE IF NOT EXISTS naive.metrics (
metric_name text, metric_timestamp timestamp, value int,
PRIMARY KEY (metric_name, metric_timestamp))
INSERT INTO naive.metrics (metric_name, metric_timestamp, value) VALUES (cpu, 2017/03/17:13:24:00:20, 10.2)
INSERT INTO naive.metrics (metric_name, metric_timestamp, value) VALUES (mem, 2017/03/17:13:24:00:20, 80.3)
@at15
at15 / cube.cu
Last active May 14, 2017 05:36
Use GPU to compute cube of a float array. A example from Udacity Intro to Parallel Programming
/*
* Example from Udacity Intro to Parallel Programming https://www.udacity.com/course/intro-to-parallel-programming--cs344
* nvcc -ccbin clang-3.8 cube.cu
*/
#include <stdio.h>
__global__ void cube(float * d_out, float * d_in){
int idx = threadIdx.x;
float f = d_in[idx];
d_out[idx] = f * f * f;
@at15
at15 / rpm- ql systemd
Last active January 8, 2017 19:28
For https://github.com/linrunner/TLP/issues/219 unable to mask systemd-rfkill@.service
at15@acer:~|⇒ rpm -ql systemd
/etc/X11/xinit/xinitrc.d/50-systemd-user.sh
/etc/X11/xorg.conf.d
/etc/X11/xorg.conf.d/00-keyboard.conf
/etc/binfmt.d
/etc/crypttab
/etc/dbus-1/system.d/org.freedesktop.hostname1.conf
/etc/dbus-1/system.d/org.freedesktop.locale1.conf
/etc/dbus-1/system.d/org.freedesktop.login1.conf
/etc/dbus-1/system.d/org.freedesktop.network1.conf
@at15
at15 / .env.sh
Created October 20, 2016 01:40
JDK and tools config
# Config JAVA
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_101
export JRE_HOME=${JAVA_HOME}/jre
export PATH=$PATH:${JAVA_HOME}/bin
# Config Maven
export MAVEN_HOME=$HOME/app/apache-maven-3.3.9
export PATH=$PATH:${MAVEN_HOME}/bin
# Config Gradle
@at15
at15 / .gitattributes
Created January 30, 2016 14:07 — forked from a-r-m-i-n/.gitattributes
.gitattributes to force LF for all text files
# Autodetect text files
* text=auto
# Force the following filetypes to have unix eols, so Windows does not break them
*.* text eol=lf
# Force images/fonts to be handled as binaries
*.jpg binary
*.jpeg binary
*.gif binary
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else