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 / README.md
Last active December 12, 2017 14:30
Google_Calendar_D3
@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 / 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 / 104life.json
Last active September 23, 2017 12:19
[
{
"key": "0 歲",
"value": 27783
},
{
"key": "10 歲",
"value": 21775
},
{
const fs = require('fs');
const axios = require('axios');
const xml2js = require('xml2js-es6-promise');
let weatherData;
const extraDataMap = (status, data) => {
return {
status: status,
time: data.$.time,
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ArvinH
ArvinH / README.md
Last active October 15, 2016 09:40

Time timer by d3.js v4

simply input minutes and you can see how many time remains through visual block

@ArvinH
ArvinH / README.md
Last active August 20, 2016 12:59
Pokemon WeaknessesGraph

(Shamelessly taken here)

Come up with this idea, but found @filipekiss has already made a great version two years ago, I upgrade to D3v4 layout (with v3 linear radial)

same rule with orginal version:

click a type name and it will show you that type weaknesses. Clicking a second type will make the graph behave for dual types.

[Yellow line] Takes Double Damage [Blue line] Takes Half Damage