Skip to content

Instantly share code, notes, and snippets.

@jjkavalam
jjkavalam / 0_reuse_code.js
Created October 15, 2016 01:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jjkavalam
jjkavalam / server.go
Last active January 9, 2024 16:32
TiddlyWiki Saver Server
// From a directory that contains your TiddlyWiki file (or download https://tiddlywiki.com/empty.html if you don't have one)
// `go run server.go`
// Navigate to the printed URL and open your wiki file
// Enjoy your changes getting saved ! (A backup of the current state is made to the `bak` directory before overwriting)
// You may configure the number of backups to keep below (See `numBackups`)
package main
import (
"fmt"
@jjkavalam
jjkavalam / server.go
Last active January 10, 2024 08:15
TiddlyWiki Saver Server (Simple)
// From a directory that contains your TiddlyWiki file (or download https://tiddlywiki.com/empty.html if you don't have one)
// `go run main.go`
// Navigate to the printed URL and open your wiki file
// Enjoy your changes getting saved !
package main
import (
"fmt"
"io"
@jjkavalam
jjkavalam / Dockerfile
Created August 26, 2024 13:01
How to correctly create a Dockerfile for Cypress test
# Pick a suitable base image matching the node version you need.
# https://hub.docker.com/r/cypress/browsers/tags is a good place to search
# I have chosen node version 22.7.0; the image comes bundled with Chrome, Firefox, Edge browsers
# with the version as indicated below
FROM cypress/browsers:node-22.7.0-chrome-127.0.6533.119-1-ff-129.0.1-edge-127.0.2651.98-1
# Now we will add our test code to this image along with any dependencies.
# We will be adding many files to this image in the steps that follow.
#
# Important! We want those files to be accessible to the UNIX user the container will run as.
@jjkavalam
jjkavalam / thiruvachanamToUnicode.js
Last active October 4, 2024 13:44
Convert Thiruvachanam font to Unicode
const Virama = "\u0d4d";
const DirectMapping = {
0x41: 'അ',
0x42: 'ആ',
0x43: 'ഇ',
0x44: 'ഉ',
0x45: 'ഋ',
0x46: 'എ',
0x47: 'ഏ',