Skip to content

Instantly share code, notes, and snippets.

@krishpop
krishpop / export-toby.js
Last active March 21, 2024 22:12
Export Toby
// code courtesy of Toby team
chrome.storage.local.get("state", o => (
((f, t) => {
let e = document.createElement("a");
e.setAttribute("href", `data:text/plain;charset=utf-8,${encodeURIComponent(t)}`);
e.setAttribute("download", f);
e.click();
})(`TobyBackup${Date.now()}.json`, o.state)
));
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active November 2, 2024 12:19
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@netsgnut
netsgnut / Coordinates.php
Last active October 16, 2017 16:39
An utility function for converting coordinates from HK80 to WGS84. Dug from an ancient project.
<?php
/**
* Coordinates.php
* An utility for converting HK80 to WGS84 coordinates
*
* Copyright (C) 2010, 2013 Kelvin Wong
* Licensed under the MIT License (http://opensource.org/licenses/MIT)
*
* Note: For the glossaries and conventions for coordinates convertion, please refer to
* the website of Geodetic Survey of Hong Kong.
@pitakakariki
pitakakariki / polls.r
Last active August 4, 2016 09:28
Code to generate an interactive SVG graph of NZ general election polling.
###
##
## --- New Zealand General Election Polling ---
##
## Plots polling data scraped from Wikipedia.
##
## - GAM -
##
## The smoothed curves are calculated using a generalised additive model (GAM). The
## smoothing parameter is estimated using cross-validation. This means that the curves