Skip to content

Instantly share code, notes, and snippets.

View juji's full-sized avatar
💭
feeling awesome

Tri Rahmat Gunadi juji

💭
feeling awesome
View GitHub Profile
@juji
juji / reset-button-style.css
Created May 12, 2024 16:28 — forked from tavareshenrique/reset-button-style.css
Reset CSS button style
button {
background: none;
color: inherit;
border: none;
padding: 0;
font: inherit;
cursor: pointer;
outline: inherit;
}
@juji
juji / fpsMeter.js
Created December 12, 2023 21:09 — forked from capfsb/fpsMeter.js
JavaScript FPS meter - Calculating frames per second
fpsMeter() {
let prevTime = Date.now(),
frames = 0;
requestAnimationFrame(function loop() {
const time = Date.now();
frames++;
if (time > prevTime + 1000) {
let fps = Math.round( ( frames * 1000 ) / ( time - prevTime ) );
prevTime = time;
@juji
juji / pandoc-svg.py
Created July 22, 2017 19:53 — forked from jeromerobert/pandoc-svg.py
Pandoc filter to create PDF files from SVG
#! /usr/bin/env python
"""
Pandoc filter to convert svg files to pdf as suggested at:
https://github.com/jgm/pandoc/issues/265#issuecomment-27317316
"""
__author__ = "Jerome Robert"
import mimetypes
import subprocess
(function addXhrProgressEvent($) {
var originalXhr = $.ajaxSettings.xhr;
$.ajaxSetup({
progress: function() { console.log("standard progress callback"); },
xhr: function() {
var req = originalXhr(), that = this;
if (req) {
if (typeof req.addEventListener == "function") {
req.addEventListener("progress", function(evt) {
that.progress(evt);