Skip to content

Instantly share code, notes, and snippets.

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

Huang Shuo-Han ArvinH

🏠
Working from home
View GitHub Profile
@ArvinH
ArvinH / 104life.json
Last active September 23, 2017 12:19
[
{
"key": "0 歲",
"value": 27783
},
{
"key": "10 歲",
"value": 21775
},
{
@ArvinH
ArvinH / order-problem.diff
Last active November 12, 2017 05:41
Regex for solving order problem
diff --git a/src/components/github-htmlview.component.js b/src/components/github-htmlview.component.js
index 1d50925..83e04d3 100644
--- a/src/components/github-htmlview.component.js
+++ b/src/components/github-htmlview.component.js
@@ -204,8 +204,10 @@ export class GithubHtmlView extends Component {
/<span class="email-hidden-toggle"><a href="#">…<\/a><\/span>/g,
''
)
- .replace(/<\/summary>/g, '</summary><hidden>')
+ .replace(/<details>/g, '<details><hidden>')
@ArvinH
ArvinH / ResizeObserver.js
Created November 23, 2017 09:18
ResizeObserver Polyfill - src: cdpn.io/WoJoNB
class ResizeObserver {
constructor() {
this.observables = [];
// Array of observed elements that looks like this:
// [{
// el: domNode,
// callback: func,
// size: {height: x, width: y}
// }]
this.boundCheck = this.check.bind(this);
@ArvinH
ArvinH / README.md
Last active December 12, 2017 14:30
Google_Calendar_D3
@ArvinH
ArvinH / googleCalendar_nodejs_parser.js
Last active December 12, 2017 17:10
googleCalendar nodejs parser
var fs = require('fs');
var readline = require('readline');
var google = require('googleapis');
var googleAuth = require('google-auth-library');
// If modifying these scopes, delete your previously saved credentials
// at ~/.credentials/calendar-nodejs-quickstart.json
var SCOPES = ['https://www.googleapis.com/auth/calendar.readonly'];
var TOKEN_DIR = (process.env.HOME || process.env.HOMEPATH ||
process.env.USERPROFILE) + '/.credentials/';
console.log('popup ready!');
let startPredicting = false;
let times = 0;
let y = 0;
document.addEventListener('DOMContentLoaded', function() {
let video = document.getElementById('video');
let still = document.getElementById('still');
chrome.runtime.onMessage.addListener(gotMessage)
function gotMessage(message, sender, sendResponse){
let direction = 0;
if(message.direction == 'up'){
direction = -500;
} else if(message.direction == 'down'){
direction = +500;
} else if (message.direction == 'turn off') {
const mask = document.getElementById('body-maskDiv');
if (mask) {
@ArvinH
ArvinH / READ.md
Last active March 27, 2018 16:19
titanic
@ArvinH
ArvinH / vimeo-python-serversample.py
Created April 14, 2018 08:04
Sample code for handling vimeo api in python server
from flask import Flask, Blueprint, request, current_app, jsonify
import requests
import json
video_blueprint = Blueprint(
'video',
__name__
)
@ArvinH
ArvinH / fetchCalendarData.js
Created December 15, 2018 15:44
2018-12-15 fetch calendar data through google api v3
const fs = require('fs');
const readline = require('readline');
const { google } = require('googleapis');
// If modifying these scopes, delete token.json.
const SCOPES = ['https://www.googleapis.com/auth/calendar.readonly'];
// The file token.json stores the user's access and refresh tokens, and is
// created automatically when the authorization flow completes for the first
// time.
const TOKEN_PATH = 'token.json';