Skip to content

Instantly share code, notes, and snippets.

🤖
He is not a human

hashrock hashrock

🤖
He is not a human
Block or report user

Report or block hashrock

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View vue-ssr.js
const Vue = require("vue");
const createRenderer = require("vue-server-renderer").createRenderer;
const compiler = require("vue-template-compiler");
const renderToString = createRenderer().renderToString;
var App = {
template: `<div>
<div v-for="item in items">{{item}}</div>
</div>`,
data() {
@hashrock
hashrock / pomodoro.py
Created May 14, 2019
My first pomodoro app for M5Stack
View pomodoro.py
from m5stack import *
import utime
import math
cnt = 0
m_cnt = cnt
start = False
done = False
def init():
View study-deno-chrome.ts
// import * as ws from "https://deno.land/std/ws/mod.ts";
//TODO 有効なChromeのパスを探す
const chrome =
"/opt/homebrew-cask/Caskroom/google-chrome/latest/Google Chrome.app/Contents/MacOS/Google Chrome";
async function main() {
const dirName = await Deno.makeTempDir({ prefix: "deno_chrome_temp" });
const width = 400;
const height = 400;
@hashrock
hashrock / svg-drag.js
Last active Feb 8, 2019
SVG Drag and Drop with React Hooks
View svg-drag.js
import React from "react";
import ReactDOM from "react-dom";
const Circle = () => {
const [position, setPosition] = React.useState({
x: 100,
y: 100,
active: false,
offset: { }
});
@hashrock
hashrock / index.js
Created Dec 12, 2018
SVG gantt renderer for scrapbox, on firebase functions
View index.js
const functions = require("firebase-functions");
const app = require("express")();
const svgContent = "image/svg+xml; charset=utf-8";
function resetHMS(d) {
d.setHours(0);
d.setMinutes(0);
d.setSeconds(0);
d.setMilliseconds(0);
@hashrock
hashrock / .htmlnanorc
Last active Dec 11, 2018
Parcel + Vue hinagata
View .htmlnanorc
{
"minifySvg": false,
"collapseWhitespace": "conservative",
"minifyCss": {
"safe": true
}
}
@hashrock
hashrock / index.ts
Last active Nov 29, 2018
Simple HTTP Server in deno (WIP), this is just a toy code, DO NOT USE THIS.
View index.ts
/**
* Simple HTTP Server
*/
import { serve } from "https://deno.land/x/net/http.ts";
import * as deno from "deno";
import { mime } from "./mime";
const addr = "0.0.0.0:8000";
const s = serve(addr);
@hashrock
hashrock / server.js
Created Dec 27, 2017
Koa my boilerplate
View server.js
const path = require('path');
const koaBody = require('koa-body');
const Koa = require('koa');
const app = module.exports = new Koa();
const datastore = require('nedb-promise')
const _ = require('koa-route');
const serve = require('koa-static');
var gsjson = require('google-spreadsheet-to-json');
app.use(koaBody());
@hashrock
hashrock / index.js
Created Dec 21, 2017
puppeteer - markdown-it - pdf(WIP)
View index.js
const fs = require('fs');
const puppeteer = require('puppeteer');
var md = require('markdown-it')();
(async() => {
var result = md.render('# markdown-it rulezz!');
var html = `
<html><head><title>Hey</title><style></style></head>
View snippets.html
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<link href="https://unpkg.com/bootstrap@4.0.0-beta.2/dist/css/bootstrap-reboot.min.css">
You can’t perform that action at this time.