Skip to content

Instantly share code, notes, and snippets.

@ArneBab
ArneBab / exwm-panel.el
Created January 30, 2024 11:17 — forked from TatriX/exwm-panel.el
Pure Elisp panel for EXWM
(defun my-setup-header-line-format ()
"Hide header line if required."
(set-window-parameter (next-window) 'header-line-format
(unless (window-at-side-p (next-window) 'top)
'none)))
(add-hook 'exwm-update-class-hook #'my-setup-header-line-format)
(set-face-attribute 'header-line nil
:background "#000000"
@ArneBab
ArneBab / 0-letterblock.js
Created April 13, 2021 00:09 — forked from atoponce/0-letterblock.js
Improve the password generator security of https://www.draketo.de/english/secure-passwords
/*
Improves the security of https://www.draketo.de/english/secure-passwords:
- Replace the letters with the original proposal at https://www.draketo.de/software/letterblock-diceware
- All bigrams are kept, rather than truncating
- Replace Math.random() with crypto.getRandomValues()
- Replace Math.floor(Math.random() * length) with uniform modulo rejection
- Replace a character count with a minimum security margin
- The HTML "Length" input should be replaced with "Security minimum" (or something similar, in bits)
- Implement the checksum per https://www.draketo.de/software/letterblock-diceware
- Use 6 characters instead of 4 (or 7) for a uniform checksum
@ArneBab
ArneBab / jdee.gradle
Last active September 2, 2018 11:24 — forked from ivv-private/jdee.gradle
jdee.gradle
// use by adding
// apply from:'jdee.gradle'
// to build.gradle
def prj = { project ->
"(jdee-project-file-version" (["1.0"])
"(jdee-set-variables" {
"'(jdee-compile-option-directory" ([project.sourceSets.main.output.classesDir])
"'(jdee-junit-working-directory" ([project.projectDir])
@ArneBab
ArneBab / Factors.java
Last active October 12, 2017 08:36 — forked from Smerity/Factors.java
Go vs GCCGO vs Java vs Python vs PyPy for naive factorisation
import java.math.BigInteger;
class Factors {
public static void main (String [] args)
{
// 157 bit n = pq with p ~= 78 bits
BigInteger n = new BigInteger("273966616513101251352941655302036077733021013991");
// Set i to be p - 10e6
BigInteger i = new BigInteger("496968652506233112158689");
@ArneBab
ArneBab / flymake-java.el
Created February 1, 2016 09:15 — forked from st63jun/flymake-java.el
Fix flymake+ant problem
;; 素のFlymakeでAntを使うとエラー吐くので,いくつか関数を書き換える必要があるっぽい.
(require 'flymake)
(setq flymake-allowed-file-name-masks
'(("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'" flymake-simple-make-init)
("\\.xml\\'" flymake-xml-init)
("\\.html?\\'" flymake-xml-init)
("\\.cs\\'" flymake-simple-make-init)
("\\.p[ml]\\'" flymake-perl-init)
@ArneBab
ArneBab / .gitignore
Last active October 8, 2015 14:39 — forked from wedesoft/.gitignore
Python Scheme integration (libguile)
*.so
*.o
*.html
.*.un~
.*.swp
@ArneBab
ArneBab / .hgsigs
Last active August 29, 2015 14:17 — forked from seeschloss/hexagons.js
8fb2e1d19eba11e40ffaa70425f1585aeef48fe5 0 iJwEAAEIAAYFAlUPNnMACgkQ3M8NswvBBUixLAP/dujl7lJDpdoR97e52NCmANPaNb3cXCVwoZ96RXyFKXMj4sFp/cN321AoVBcThfHTco2NV02rTRQD9ZzrWIlTC412qezijC8hqBle9w9G1w5JWCIaLUX18vz/MECLj5Y/UQU7mvh8Dd7okfJxvDIYKzw1A6IQxd9hB31SS1xgbbA=
@ArneBab
ArneBab / freestream.sh
Last active September 2, 2018 11:04 — forked from bertm/freestream.sh
#!/bin/bash
# This script uses x264 and ffmpeg to recode an input video to low-bitrate MPEG-TS segmented h264
# stream that is suitable for streaming over the web and can be inserted into Freenet.
# Settings have been chosen to strongly prefer quality over encoding speed under conditions of an
# extremely low bitrate, to make the result suitable for direct streaming over Freenet.
#
# (c) bertm, 2014
#
# Prefix for file names in the playlist