Skip to content

Instantly share code, notes, and snippets.

View ThisIsTian's full-sized avatar
🏠
Working from home

Tiantian Xie ThisIsTian

🏠
Working from home
View GitHub Profile
@ThisIsTian
ThisIsTian / EMV_Var_Compare.m
Last active December 10, 2018 17:58
Exponentioal Moving Variance and the standard Variance comparison
%==========================================================================
% Exponentioal Moving Variance and the standard Variance comparison
% Created by: Tiantian Xie (Dec. 10th, 2018)
%==========================================================================
clear;
close all;
NumberOfSamples = 500;
X = rand(NumberOfSamples,1);
WindowSize = 25;
@ThisIsTian
ThisIsTian / pre_render_d3_graph.js
Created January 29, 2018 05:11 — forked from danioyuan/pre_render_d3_graph.js
Render d3 force-directed graph on server side. Require Node.js, d3.js, and jsdom.
// Pre-render d3 force-directed graph at server side
// Call node pre_render_d3_graph.js to generate d3_graph.html
// Original idea and framework borrowed from https://gist.github.com/mef/7044786
var d3 = require('d3')
, jsdom = require('jsdom')
, fs = require('fs')
, htmlStub = '<html><head> \
<style>.node { stroke: #fff; fill: #ccc; stroke-width: 1.5px; } \
.link { stroke: #333; stroke-opacity: .5; stroke-width: 1.5px; }</style> \
@ThisIsTian
ThisIsTian / multiple_sensortag.js
Created January 19, 2018 23:20 — forked from ma2shita/multiple_sensortag.js
Example code of read sensor data of multiple SensorTag (CC2541DK-SENSOR, CC2650STK) at same time by using node-sensortag
/*
* Example code of read sensor data of multiple SensorTag (CC2541DK-SENSOR, CC2650STK) at same time by using node-sensortag
*
* Node.js 0.10.36 or higher (4.4.2 ready)
*
* Usage;
* $ npm install sensortag async
* $ node multiple_sensortag.js
*
* e.g.)
@ThisIsTian
ThisIsTian / dlAttachments.py
Created December 11, 2017 15:22 — forked from baali/dlAttachments.py
Python script to download all gmail attachments.
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail
# Make sure you have IMAP enabled in your gmail settings.
# Right now it won't download same file name twice even if their contents are different.
import email
import getpass, imaplib
import os
import sys
detach_dir = '.'