Skip to content

Instantly share code, notes, and snippets.

View nauzilus's full-sized avatar
💭
🤠

Daniel Flint nauzilus

💭
🤠
View GitHub Profile
@nauzilus
nauzilus / resume.json
Last active February 23, 2023 10:15
resume.json
{
"meta": {
"theme": "elegant"
},
"basics": {
"name": "Daniel Flint",
"label": "Software Engineer",
"picture": "https://avatars.githubusercontent.com/u/5241145?v=4",
"image": "https://avatars.githubusercontent.com/u/5241145?v=4",
"website": "https://danielflint.im",
npm ERR! code ENOVERSIONS
npm ERR! No valid versions available for package
$ npm show package
npm ERR! code E404
npm ERR! 404 Unpublished by npm-support on 2019-01-07T19:02:25.168Z
npm ERR! 404
npm ERR! 404 'package' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
@nauzilus
nauzilus / poor-mans-redux.ts
Last active May 30, 2018 10:15
poor mans redux
interface IAction<T> {
type: string;
payload: T;
}
interface IUnsub {
(): void;
}
interface IStateListener<IState> {
// ==UserScript==
// @name HTSK
// @namespace https://www.howtostudykorean.com/
// @version 0.3
// @description Blurs out the English translation of examples on HowToStudyKorean.com until you hover over them, so you can try to understand the Korean first.
// @author Daniel Flint <daniel@nauzilus.net>
// @match https://www.howtostudykorean.com/*
// @grant none
// ==/UserScript==
@nauzilus
nauzilus / stream_vs_array.js
Last active December 25, 2023 10:52
(Highland) stream vs array transformation
(function() {
var highland = require("highland")
var array = [1,2,3],
spy = (message, fn) => {
return x => {
console.log(`${message} ${x}`)
return fn(x)
}
},
@nauzilus
nauzilus / bookmarklet-min.js
Last active September 10, 2015 01:35
Prism Custom Themes
javascript:(function(t){t("https://api.github.com/gists/a216f6a5e5e74eec0fde","script.js","customthemes")}(function(t){return function(n,e,c){if(!t.getElementById(c)){var i=function(n){var e=t.createElement("script");n&&n(e),t.head.appendChild(e)},o=c+Math.floor(Date.now()/864e5);window[o]=function(t){i(function(n){n.id=c,n.innerHTML=t.data.files[e].content})},i(function(t){t.src=n+"?callback="+o})}}}(document)));
@nauzilus
nauzilus / script.js
Last active July 4, 2016 11:20
Generator
var gen = function(str) {
var g_datetime = function(flags) {
var date = new Date();
if (flags["<"] ^ flags[">"]) {
var dayTicks = 86400000,
midnight=new Date(date.getTime() - ( ( date.getTime() - ( date.getTimezoneOffset() * 60000 ) ) % dayTicks )),
mins=~~(date.getTime() - midnight.getTime()),
tOffset=g_number.apply(null, flags.t ? flags["<"] ? [0,mins] : [mins,dayTicks] : [0,dayTicks]),
dOffset=g_number(1,365)*dayTicks*(flags["<"]?-1:1);
date = new Date(midnight.getTime() + (flags.t && !flags.d ? 0 : dOffset) + tOffset);
@nauzilus
nauzilus / bookmarklet.js
Last active August 29, 2015 14:22
Toggle Tables
javascript:(function(){
var id = "df-showtables";
var style=document.getElementById(id);
if (style) {
style.remove();
}
else {
style = document.createElement("style");
style.id=id;
style.textContent = "table { border: 2px solid #BD1DEA; table-collapse: collapse; } td { border: 1px solid #BADA55; }";
@nauzilus
nauzilus / keyboardnav.js
Created May 27, 2015 23:02
Simple Keyboard Navigation
(function(selector) {
// not handling DOM changes. yet.
var posts = document.querySelectorAll(selector);
var topTollerance = 10;
var multiplier = 0;
function post_nav(e) {
if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
var dir = 0;
var key = (""+(e.keyCode || e.code || e.key || "")).toLowerCase();
@nauzilus
nauzilus / bookmarklet.js
Last active August 29, 2015 14:21
Destyle
(function(){
var $=function(selector){
return [].slice.call(document.querySelectorAll(selector));
};
$("style,link[rel='stylesheet'],img,video,object").forEach(function(v) {
v.remove();
})
$("[style]").forEach(function(v) {
v.removeAttribute("style")
});