Skip to content

Instantly share code, notes, and snippets.

View angel333's full-sized avatar

Ondra Simek angel333

View GitHub Profile
@angel333
angel333 / DWM-ON-OS-X.md
Last active April 11, 2024 16:14 — forked from vangberg/DWM-ON-OS-X.md
Updated for .xinitrc.d and $USERWM, simplified

Installing and configuring dwm on OS X (tested on Mountain Lion, Mavericks)

  1. Install XQuartz.

  2. Install dwm using Homebrew (or whatever):

    brew install dwm
    
  3. Create a xinitrc.d script for dwm:

#!/bin/bash
#
# Certbot hook for Hurricane Electric DNS service
#
# Usage:
#
# Renew all certificates:
# HE_SESSID=<session_id> certbot renew \
# --preferred-challenges dns \
@angel333
angel333 / youtube-playlist-duration.js
Last active August 15, 2021 19:33
Youtube playlist duration
// Just copy this into console while on a playlist page (https://www.youtube.com/playlist?list=.....)
alert(((document) => {
let seconds = Array.from(document.querySelectorAll('.pl-video-time .timestamp span'))
.map((span) => {
let time = span.textContent.split(':');
return (Number(time[0]) * 60) + Number(time[1]);
})
.reduce((a,b) => {
return a + b;
/*
* Simple hash function that uses Web Cryptography API
* @param {string} algo - SHA-1/SHA-256/SHA-384/SHA-512
* @param {string} text - text to compute digest from
* @return {Promise} - A promise returning text.
*/
function hash (algo, text) {
const encoded = new TextEncoder().encode(text);
return window.crypto.subtle.digest(algo, encoded)
.then(result =>

The Best 18650 Batteries (last update: 2016-12-08)

This is similar to best18650battery.com but much simpler and better updated. These are the absolute top 18650s.

Name Model Capacity Discharge Fasttech links Note
Sony [US18650VTC6][d-vtc6] 3120mAh 30A [1pcs][vtc6-1], [2-pack][vtc6-2], [4-pack][vtc6-4]
LG Chem [INR18650MJ1][d-mj1] 3500mAh 10A [1pcs][mj1-1], [2-pack][mj1-2], [4-pack][mj1-4]
Sanyo (Panasonic) [NCR18650GA][d-ga] 3500mAh* 10A [1pcs][ga-1], [2-pack][ga-2], [4-pack][ga-4] NCR**
Samsung SDI [INR18650-35E][d-35e] >3350mAh 8A [1pcs][
@angel333
angel333 / infimouse.au3
Created December 6, 2016 13:52
If you move mouse to one border, it'll come from the other.
;
; Infimouse.au3
; an AutoIt script
;
; Author: Ondrej Simek
; License: MIT
;
; If you move mouse to one border, it'll come from the other.
;
; Works for multiple screens too, but will have issues if the screen
@angel333
angel333 / yum-installed
Last active November 19, 2016 14:53
This one-liner will list packages that were explicitly installed by user.
#/bin/sh
# Description: Lists packages that were explicitly installed by user.
# Run this: curl -Ls goo.gl/RV7oiB | sh
export LC_ALL=C
MIN=2 # First is the OS installation
MAX=$(yum history | awk 'NR==4 { print $1 }')
<html>
<head>
<title>hi</title>
</head>
<body>
hi
</body>
</html>
<script src='bench.js'></script>
package gui;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JMenu;