Skip to content

Instantly share code, notes, and snippets.

View TomLisankie's full-sized avatar

Thomas Lisankie TomLisankie

View GitHub Profile
@kepano
kepano / obsidian-web-clipper.js
Last active May 28, 2024 16:23
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
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 */
const vault = "";
/* Optional folder name such as "Clippings/" */
@malcolmocean
malcolmocean / twitter-no-bother.user.js
Last active February 6, 2024 22:52
Twitter Userscript - no unread bothers in title & favicon
// ==UserScript==
// @name Twitter - no unread bothers in title & favicon
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Wanting to leave a tweet open for reference but the (1)
// in the title or the red dot in the favicon make you check
// notifications? This script removes both!
// @author @Malcolm_Ocean
// @match https://twitter.com/*
// @grant none

TL;DR: what was the bug? (spoilers!): https://gist.github.com/trptcolin/6039cd454acfe6e820d13cbdce5e4064

@bogaotory
bogaotory / install_bionic_on_x1c6.md
Last active May 15, 2024 03:25
Install Ubuntu 18.04 on Thinkpad X1 Carbon 6th Generation

Install Ubuntu 18.04 on Thinkpad X1 Carbon 6th Gen/2018

X1C6 Type: 20KG*

Bionic works out of the box on the new 2018 X1 Carbon. The X1C6 is a beautiful laptop, and Bionic is the best Ubuntu yet. Users of all levels of experties/experiences are recommended to try this combination. The purpose of this documentation is to improve the user's experience.

BIOS/UEFI Changes

Following changes are required by the DSDT patch:

  1. Turn off Secure Boot
@olieidel
olieidel / delete_recursive.clj
Last active June 4, 2023 16:12
Delete Directories recursively with Clojure in only 4 lines of code.
(ns yourproject.yourns
(:require [clojure.java.io :as io]))
(defn delete-directory-recursive
"Recursively delete a directory."
[^java.io.File file]
;; when `file` is a directory, list its entries and call this
;; function with each entry. can't `recur` here as it's not a tail
;; position, sadly. could cause a stack overflow for many entries?
;; thanks to @nikolavojicic for the idea to use `run!` instead of
@gaearon
gaearon / modern_js.md
Last active April 18, 2024 15:01
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@longsangstan
longsangstan / react-text-file-reader.js
Created April 27, 2017 03:30
A React component to read text file.
import React from "react";
/*
Read a text file and out put the content.
Example Usage:
var myTxt = require("./myTxt.txt");
...
@lazywithclass
lazywithclass / blog-post.md
Last active April 26, 2024 18:22
Looking at the most beautiful program ever written - part 1

Looking at the most beautiful program ever written - part 1

I am going to have a look at what William Byrd presented as The most beautiful program ever written.

Beauty here refers to computer programs, specifically about Lisp. There might be errors as this is something I wrote to make sense of that interpreter, proceed at your own risk.

Thanks a lot to Carl J. Factora for the help.

The program

@zehnpaard
zehnpaard / simple-hiccup.core.clj
Last active March 25, 2023 02:04
Simple Ring/Compojure/Hiccup Demo
(ns simple-hiccup.core
(require
[ring.adapter.jetty :refer [run-jetty]]
[simple-hiccup.middleware :as m]
[simple-hiccup.routes :as r]
))
(def app
(-> r/routes
m/logger
@zehnpaard
zehnpaard / simple-compojure.core.clj
Created October 30, 2016 06:03
Simple Compojure Demo with GET/POST forms
(ns simple-compojure.core
(require
[ring.adapter.jetty :refer [run-jetty]]
[ring.middleware.params :as p]
[simple-compojure.middleware :as m]
[simple-compojure.routes :as r]
))
(def app
(-> r/routes