Skip to content

Instantly share code, notes, and snippets.

View pascaliske's full-sized avatar
👋
Hi, what's up?

Pascal Iske pascaliske

👋
Hi, what's up?
View GitHub Profile
@pascaliske
pascaliske / jsonview-solarized.css
Created February 8, 2018 12:05 — forked from iansym/jsonview-solarized.css
JSON View solarized theme for Chrome Extension
body {
background-color: #002b36;
color: #839496;
font-size: 14px;
white-space: pre !important;
font-family: "Source Code Pro", monospace;
}
.property {
font-weight: bold;
@pascaliske
pascaliske / diff.ts
Last active August 23, 2018 20:23 — forked from mailtruck/colormeter.js
Calculate difference in percentage between 2 hex colors
export function diff(color1: string, color2: string): number {
if (!color1 && !color2) {
return;
}
const _color1 = color1.charAt(0) == '#' ? color1.substring(1, 7) : color1;
const _color2 = color2.charAt(0) == '#' ? color2.substring(1, 7) : color2;
const rColor1 = parseInt(_color1.substring(0, 2), 16);
const gColor1 = parseInt(_color1.substring(2, 4), 16);
@pascaliske
pascaliske / sudo-keepalive-example.sh
Created March 5, 2017 17:27 — forked from cowboy/sudo-keepalive-example.sh
Bash: Sudo keep-alive (good for long-running scripts that need sudo internally but shouldn't be run with sudo)
#!/bin/bash
# Might as well ask for password up-front, right?
sudo -v
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Example: do stuff over the next 30+ mins that requires sudo here or there.
function wait() {