Skip to content

Instantly share code, notes, and snippets.

@ismyrnow
ismyrnow / mac-clear-icon-cache.sh
Created May 5, 2017 19:28
Clear the icon cache on a Mac when you start seeing generic icons in Finder or the Dock
sudo rm -rfv /Library/Caches/com.apple.iconservices.store; sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \; ; sleep 3;sudo touch /Applications/* ; killall Dock; killall Finder
@ismyrnow
ismyrnow / openssl.cnf
Last active August 2, 2023 19:38
Certificate creation in Windows
[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no
default_md = sha224
[req_distinguished_name]
CN = localhost.ssl
[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
@ismyrnow
ismyrnow / tg-test-api.js
Created March 10, 2023 03:32
Module for async access to a fake task and user API
// A reference implementation of an API service that stores data in memory,
// and executes asynchronous CRUD operations on tasks and users.
// ---
//
// getUsers() : Promise{Array.<User>}
// getTasks() : Promise{Array.<Task>}
// updateTask(PartialTask) : Task
// createTask(NewTask) : Task
// deleteTask(id) : void
//
@ismyrnow
ismyrnow / git-branch-cleanup.md
Last active October 12, 2022 14:18
Cleanup Git Branches

Delete merged branches

git branch --merged | egrep -v "(^\*|master)" | xargs git branch -d

Delete local refs to remote branches that no longer exist

git fetch --prune
@ismyrnow
ismyrnow / retire.clj
Created July 22, 2022 01:34
When would you like to retire? IN CLOJURE!!!
(do
(print "How old are you? ")
(def currentAge (Integer/parseInt (read-line)))
(flush)
(println currentAge)
(print "At what age would you like to retire?")
(flush)
(def retirementAge (Integer/parseInt (read-line)))
(println retirementAge)
(def yearsToRetirement (- retirementAge currentAge))
@ismyrnow
ismyrnow / google-analytics-amd.js
Last active March 14, 2022 21:32
Google Analytics AMD Module
define(function (require) {
var module;
// Setup temporary Google Analytics objects.
window.GoogleAnalyticsObject = "ga";
window.ga = function () { (window.ga.q = window.ga.q || []).push(arguments); };
window.ga.l = 1 * new Date();
// Immediately add a pageview event to the queue.
@ismyrnow
ismyrnow / index.html
Created July 31, 2013 16:17
Leaflet.GroupedLayerControl
<!DOCTYPE html>
<html>
<head>
<title>Basic example</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.2/leaflet.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.2/leaflet.ie.css" /><![endif]-->
<style type="text/css">
@ismyrnow
ismyrnow / setup-parameterized-tests.js
Created December 14, 2018 18:47
Parameterized test helper for Jest
/**
* Setup parameterized tests for a dictionary of inputs and outputs.
* This allows you to run tests over a list of inputs and outputs,
* without much setup. For example:
*
* setupParameterizedTests(x => getFirstName(x))([
* ['John M. Smith', 'John'],
* ['Joe Schmoe Jr.', 'Joe']
* ]);
*
@ismyrnow
ismyrnow / package-lock-reset.sh
Last active March 4, 2020 18:37
Reset weird package-lock changes
rm -rf ./node_modules
npm cache clean --force
npm install --prefer-online
@ismyrnow
ismyrnow / compact-cards.css
Last active November 5, 2019 17:30
TeamGantt Stylish Styles
.board-card .card-body .user-icons,
.board-card .card-body .notification-wrapper,
.card-header .static-task-progress {
display: none;
}
.board-column {
width: 400px;
}