Skip to content

Instantly share code, notes, and snippets.

View wf9a5m75's full-sized avatar
💭
I may be slow to respond.

Masashi Katsumata wf9a5m75

💭
I may be slow to respond.
View GitHub Profile
import time
from typing import List
from random import randint
def measure(func):
def wrapper(*args, **kargs):
start_time = time.perf_counter()
result = func(*args, **kargs)
import time
from typing import List
from random import randint
def measure(func):
def wrapper(*args, **kargs):
start_time = time.perf_counter()
result = func(*args, **kargs)
// --------------------------------------------------------------------------
// Following code is for utilities
// --------------------------------------------------------------------------
/**
* @params zeroShift {function} The function you want to test
* @params debug {boolean} Sets true for including the function result
*/
const checkTests = (targetFunction, debug) => {
// --------------------------
@wf9a5m75
wf9a5m75 / index.css
Created March 9, 2022 16:57 — forked from stereokai/index.css
Trigonometry in CSS
//----------------------------------*\
// TRIGONOMETRY FUNCTIONS
//----------------------------------*/
// # Trigonometry in CSS
//
// - Through Taylor/Maclaurin polynomial representation: http://people.math.sc.edu/girardi/m142/handouts/10sTaylorPolySeries.pdf
// - Useful if you don't want to use JS.
// - With CSS Variables.
// - `calc()` can't do power (x ^ y) so I used multiplication instead.
@wf9a5m75
wf9a5m75 / layout.html
Created July 20, 2018 06:40
hapi.js(v17.5.2) + handlebars.js(v4.0.11) with dynamic template load
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/css/test.css">
</head>
<body>
{{ hello }}
</body>
</html>
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Style id="globalStyles">
<LineStyle id="line">
<color>7f0000ff</color>
<width>4</width>
</LineStyle>
</Style>
<Placemark>
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Placemark>
<name>Blue</name>
<description>Should be red.</description>
<Style>
<BalloonStyle>
<bgColor>ff0000ff</bgColor>
</BalloonStyle>
@wf9a5m75
wf9a5m75 / Dockerfile
Last active August 16, 2018 09:48 — forked from balachandarlinks/Dockerfile
Dockerfile for https://github.com/gojuno/mainframer remote android build system.
FROM ubuntu:16.04
MAINTAINER Balachandar KM "[email protected]"
# Install java8
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:webupd8team/java && \
(echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections) && \
apt-get update && \
@wf9a5m75
wf9a5m75 / starbucks_us_locations.json
Last active October 14, 2023 16:49 — forked from dankohn/starbucks_us_locations.csv
8902 locations of US Starbucks with addresses, latitude, and longitude
This file has been truncated, but you can view the full file.
[
{
"position": {
"lat": 61.21759217,
"lng": -149.8935557
},
"name": "Starbucks - AK - Anchorage 00001",
"address": "601 West Street_601 West 5th Avenue_Anchorage, Alaska 99501",
"phone": "907-277-2477"
},
var CLIENT_ID = ""
var CLIENT_SECRET = ""
var REDIRECT_URL = ""
var REFRESH_TOKEN = "";
var async = require('async');
var google = require('googleapis');
var OAuth2 = google.auth.OAuth2;
var oauth2Client = new OAuth2(CLIENT_ID, CLIENT_SECRET, REDIRECT_URL);