Skip to content

Instantly share code, notes, and snippets.

@Fenntasy
Fenntasy / OnClickOutside.js
Created November 16, 2015 15:15
Mixin to check if someone has clicked outside of the current react element
import { findDOMNode } from 'react-dom'
const OnClickOutside = {
componentDidMount: function() {
if(!this.handleClickOutside) {
throw new Error('missing handleClickOutside(event) function in Component ' + this.displayName)
}
document.addEventListener("click", this.listenForClickOutside)
},
// ==UserScript==
// @name Youtube watch later total duration
// @namespace http://vincent.billey.me
// @version 0.1
// @description Displays the total duration of your watch later playlist on youtube
// @author You
// @match https://www.youtube.com/playlist?list=WL
// @grant none
// ==/UserScript==
module Main exposing (..)
import Html.App exposing (program)
import Html exposing (div, button, text, input)
import Html.Events exposing (onClick, onInput)
import Time exposing (Time, second)
import String
import Task
// ==UserScript==
// @name Monabanq tabindex safety
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.monabanq.com/*
// @grant none
// ==/UserScript==
@Fenntasy
Fenntasy / watcher.js
Created February 1, 2017 23:24
Elm watcher
/* eslint no-console: "off" */
var spawn = require('child_process').spawn;
var fs = require("fs");
var chokidar = require('chokidar');
var sass = require('node-sass');
var chalk = require('chalk');
var connect = require('connect');
var serveStatic = require('serve-static');
var watcher = chokidar.watch(
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
defmodule MyProducer do
use GenStage
def start_link(list) do
GenStage.start_link(__MODULE__, list)
end
def init(list) do
{:producer, list}
end
@Fenntasy
Fenntasy / obsidian-web-clipper.js
Last active September 6, 2021 20:15 — forked from kepano/obsidian-web-clipper.js
Obsidian Bookmarklet to clip pages
javascript: Promise.all([
import('https://unpkg.com/turndown@6.0.0?module'),
import('https://unpkg.com/@tehshrike/readability@0.2.0'),
]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
let sentence = "A cool sentence";
const favoriteNumber = 41;
const listOfThings = ["keys", "lamp", "headphones"];
const walkmanSpecifications = {
name: "TPS-L2",
yean: "1979",
color: "Blue & Silver",
battery: "AA x2",
}