Skip to content

Instantly share code, notes, and snippets.

@max6cn
max6cn / lspci.log
Created February 23, 2017 21:44
Z420 Hardware
\-[0000:00]-+-00.0 Intel Corporation Xeon E5/Core i7 DMI2
+-01.0-[03]--
+-02.0-[05]--+-00.0 NVIDIA Corporation GP106 [GeForce GTX 1060 6GB]
| \-00.1 NVIDIA Corporation Device 10f1
+-03.0-[04]--
+-05.0 Intel Corporation Xeon E5/Core i7 Address Map, VTd_Misc, System Management
+-05.2 Intel Corporation Xeon E5/Core i7 Control Status and Global Errors
+-05.4 Intel Corporation Xeon E5/Core i7 I/O APIC
+-11.0-[02]----00.0 Intel Corporation C602 chipset 4-Port SATA Storage Control Unit
+-16.0 Intel Corporation C600/X79 series chipset MEI Controller #1
@max6cn
max6cn / sync.log
Created December 30, 2016 14:25
Fast Repo sync
$ repo init -u git://github.com/CyanogenMod/android.git -b cm-14.1
$ time repo sync
Checking out files: 100% (11758/11758), done. files: 36% (4277/11758)
Checking out files: 100% (11670/11670), done.t files: 10% (1201/11670)
Checking out files: 100% (8423/8423), done.out files: 33% (2848/8423)
Checking out files: 100% (1411/1411), done.out files: 6% (87/1411)
Checking out files: 100% (19766/19766), done.ut files: 35% (6940/19766)
Checking out files: 100% (4953/4953), done. out files: 46% (2324/4953)
@max6cn
max6cn / Awesome Chocolatey.md
Last active November 6, 2016 04:14
A curated list of Chocolatey packages
choco install ffmpeg
choco install inkscape 
choco install cpu-z 
choco install speccy 
choco install mpc-hc
choco install googleearth 
choco install winmerge
choco install vim
choco install procexp
@max6cn
max6cn / sensortest.py
Created September 29, 2016 22:14
Test Scripts for Sensor Project
import serial, time
import sys
import threading
# initialization and open the port
# possible timeout values:
# 1. None: wait forever, block call
# 2. 0: non-blocking mode, return immediately
# 3. x, x is bigger than 0, float allowed, timeout block call
@max6cn
max6cn / gitflow-breakdown.md
Created June 9, 2016 04:28 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository

@max6cn
max6cn / gitcp
Last active May 22, 2016 10:18
A cli tool to copy github sub folder, usage: gitcp url
#!/bin/bash -f
# full_url=$1
# echo $full_url
# t="https://github.com/facebook/stetho/tree/master/stetho-sample"
IFS='/' read -ra url <<< $1
full_url=($url)
repo_name=${full_url[3]}
repo_base=${full_url[2]}"/"${full_url[3]}
branch=${full_url[5]}
@max6cn
max6cn / AddCookiesInterceptor.java
Created May 18, 2016 09:26 — forked from tsuharesu/AddCookiesInterceptor.java
Handle Cookies easily with Retrofit/OkHttp
/**
* This interceptor put all the Cookies in Preferences in the Request.
* Your implementation on how to get the Preferences MAY VARY.
* <p>
* Created by tsuharesu on 4/1/15.
*/
public class AddCookiesInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
@max6cn
max6cn / convertpdf.sh
Last active May 16, 2016 22:09
Script to add margin to a PDF file and merge with page number on footer(can be header also)
#!/bin/bash -f
prepocesse() {
pdfinfo newbook.pdf
pdflatex pageNumbers.tex
pdftk newbook.pdf burst output tmps/file_%04d.pdf
pdftk pageNumbers.pdf burst output tmps/number_%04d.pdf
}
format() {
#!/usr/bin/env python3
from collections import defaultdict
import copy
def read(fd,t=int):
return t(fd.readline())
def readlist(fd, t=int):
@max6cn
max6cn / jquery.iframe_to_div.js
Created March 19, 2016 05:44 — forked from aklump/jquery.iframe_to_div.js
A jQuery plugin to replace iframes with divs containing their source by loading via ajax. Benefits use parent page's css and have an auto height to your iframe.
/**
* Convert iframes to divs via ajax iframe_to_div jQuery Plugin
*
* Uses javascript to replace iframes with divs containing their source content
* by loading via ajax. If you use this to load vanilla html snippets, this has the
* effect of applying the page's css to your vanilla html snippet.
*
* This will not work if the iframe src is not a relative link due to ajax restrictions across domains.
*
* As an example: