Skip to content

Instantly share code, notes, and snippets.

@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active June 24, 2026 07:05
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@heroheman
heroheman / ranger-cheatsheet.md
Last active July 17, 2026 19:16
Ranger Cheatsheet

Ranger Cheatsheet

General

Shortcut Description
ranger Start Ranger
Q Quit Ranger
R Reload current directory
? Ranger Manpages / Shortcuts
@andyrbell
andyrbell / scanner.sh
Last active July 6, 2026 00:17
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@ThatGuySam
ThatGuySam / time-since.php
Last active March 5, 2025 14:53
Time since Shortcode for Wordpress
<?php
// ex:
// With [time since="1997"] years experience
// outputs: With 20 years of experience
class SCCTimeShortcode {
static $add_script;
static function init() {
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
denumire,localitate,adresa,telefon,localitati_deservite
Direcția Generală Regională a Finanțelor Publice PLOIEȘTI,Ploiești,"Str. Aurel Vlaicu nr. 22, C.P. 00023, Jud. Prahova",0244.407.7 0,Ploiești
Administrația pentru Contribuabili Mijlocii - D.G.R.F.P. Ploiești,Ploiești,"Str. Gh. Grigore Cantacuzino nr. 348, C.P. 0030 ,Jud. Prahova",0244.700.930,Ploiești
Administrația Județeană a Finanțelor Publice ARGEȘ,Argeș,"B-dul Republicii nr. 118, Pitești, C.P.110050","0248.211.511, 0248.211.838","Albota, Bascov, Băbana, Bradu, Budeasa, Ciomăgești, Cocu, Cotmeana, Cuca, Drăganu, Mărăcineni, Merișani, Morărești, Moșoaia, Oarja, Pitești, Poiana Lacului, Săpata, Suseni, Ștefănești, Uda, Vedea"
Serviciul fiscal municipal Câmpulung,Câmpulung,"Str. Negru Vodă nr.117 și Str.Negru Vodă nr.84, C.P. 115100","0248/510830, 0248/510159","Câmpulung, Albeștii de Muscel, Aninoasa, Boteni, Berevoiești, Bughea de Jos, Bughea de Sus, Cetățeni, Dâmbovicioara, Dragoslavele, Godeni, Lerești, Mihăești, Mioarele, Poienarii de Muscel, Stoeneș
/* Center of Gravity Finder
This script will find the center of gravity (centroid) of all closed paths in the selection set. It was built for a specific purpose so does not have much error
handling. For example, if you get errors it may be the result of the selection set containing compound shapes or a self-intersecting polygon.
References for the math:
http://paulbourke.net/geometry/polygonmesh/ (Calculating the area and centroid of a polygon)
https://en.wikipedia.org/wiki/Centroid#Centroid_of_polygon
Save this file with a jsx extension and place in your Illustrator/Presets/en_US/Scripts folder. You can then access it from the File > Scripts menu
@arthurattwell
arthurattwell / dialog.html
Last active August 1, 2022 09:54
Google Sheets script to allow multi-select in cells with data-validation (adapted from https://www.youtube.com/watch?v=dm4z9l26O0I)
<div style="font-family: sans-serif;">
<? var data = valid(); ?>
<form id="form" name="form">
<? if(Object.prototype.toString.call(data) === '[object Array]') { ?>
<? for (var i = 0; i < data.length; i++) { ?>
<? for (var j = 0; j < data[i].length; j++) { ?>
<input type="checkbox" id="ch<?= '' + i + j ?>" name="ch<?= '' + i + j ?>" value="<?= data[i][j] ?>"><?= data[i][j] ?><br>
<? } ?>
<? } ?>
<? } else { ?>
@yazinsai
yazinsai / ImportJSON.gs
Created April 26, 2016 13:38
Get data from any API straight into your Google Sheets, effortlessly!
/*====================================================================================================================================*
ImportJSON by Trevor Lohrbeer (@FastFedora)
====================================================================================================================================
Version: 1.2.1
Project Page: http://blog.fastfedora.com/projects/import-json
Copyright: (c) 2012-2013 by Trevor Lohrbeer
License: GNU General Public License, version 3 (GPL-3.0)
http://www.opensource.org/licenses/gpl-3.0.html
------------------------------------------------------------------------------------------------------------------------------------
A library for importing JSON feeds into Google spreadsheets. Functions include:
@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active April 14, 2026 19:34
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@manigandham
manigandham / rich-text-html-editors.md
Last active November 30, 2025 19:04
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors