Skip to content

Instantly share code, notes, and snippets.

@Sidchou
Sidchou / README-Template.md
Created April 9, 2020 18:35 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@Sidchou
Sidchou / d3 test
Last active April 1, 2020 22:48
d3 test
let parseDate = d3.timeParse("%m/%d/%Y")
let data = [];
d3.csv("prices.csv",(d)=>{return{
month: parseDate(d.month),
price: Number(d.price.slice(1))
}
})
.then((d)=>{
@Sidchou
Sidchou / adafruit_MiCS5524
Last active March 24, 2020 23:04
Adafruit MiCS5524 CO, Alcohol and VOC Gas Sensor Breakout test code
/*
simple test code for Adafruit MiCS5524 CO, Alcohol and VOC Gas Sensor Breakout board
https://www.adafruit.com/product/3199
*/
const int enPin = 4;
const int analogPin = A1;
//declare pin using
void setup() {
// put your setup code here, to run once:
pinMode(enPin, OUTPUT);
@Sidchou
Sidchou / MQ2_Test
Last active March 24, 2020 23:04
MQ2 sensor test
/*
simple code to test MQ-2 Gas Sensor Detection Module
*/
const int digitalPin = 3;
const int analogPin = A0;
//declare input pins
void setup() {
// put your setup code here, to run once:
pinMode(digitalPin, INPUT);
pinMode(analogPin, INPUT);
@Sidchou
Sidchou / hideText_Sid
Created February 10, 2019 19:09
hide text by Sid
javascript: (function() {
function injectJquery(callback) {
if (window.jQuery) {
return callback(window.jQuery);
}
let script = document.createElement('script');
script.setAttribute('src', '//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js');
script.onload = () => callback(window.jQuery);
script.onerror = e => alert('The script failed to load: '
e);
@Sidchou
Sidchou / textUglify_Sid
Created February 10, 2019 18:35
change text on the wepage
function getTextNodes() {
var nodes = [];
var treeWalker = document.createTreeWalker(
document.body,
NodeFilter.SHOW_TEXT,
{ acceptNode: function(node) { return NodeFilter.FILTER_ACCEPT; } },
false
);
while(treeWalker.nextNode()) {
var parentNode = treeWalker.currentNode.parentNode;