This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(comment | |
(import '[java.time Duration]) | |
@(def subs (slurp "/Users/felipecortez/suboverride.ttml")) | |
(spit "/Users/felipecortez/suboverride-good.ttml" | |
(clojure.string/replace subs #"\d\d:\d\d:\d\d\.\d\d\d" shifted))) | |
(defn shifted [cue-timing] | |
(let [[h m s ms] (map #(Integer/parseInt % 10) (str/split cue-timing #"[:.]")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/bin/env bash | |
line=$(echo "· interpunct|◊ diamond" | rofi -sep '|' -dmenu -p) | |
exit_code=$? | |
printf $line | bb -i '(println (str (ffirst *input*)))' | iconv -f UTF8 -t UTF16BE | xvkbd -utf16 -file - | |
# for debugging LE/BE iconv | |
# od -A x -t x1z -v | |
# babashka definitely is overkill |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, unzip, pkgs, autoPatchelfHook, zlib}: | |
pkgs.stdenv.mkDerivation { | |
name = "babashkabin"; | |
src = pkgs.fetchurl { | |
url = "https://github.com/borkdude/babashka/releases/download/v0.2.4/babashka-0.2.4-linux-amd64.zip"; | |
sha256 = "d56ff45b80226685bf2f804718780a82d30cffa4bda701a28cb170de176bc1fa"; | |
}; | |
nativeBuildInputs = [ unzip autoPatchelfHook ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clojure.java.io :as io]) | |
(defn visit-print | |
"println approach" | |
[path level] | |
(when (some #(clojure.string/includes? % ".md") (file-seq (io/file path))) | |
(println (str (apply str (repeat level " ")) "- " (.getName (io/file path)))) | |
(doseq [path (.listFiles (io/file path))] (visit-print path (inc level))))) | |
(defn visit-print |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bindsym $mod+d exec "rofi -matching fuzzy -show run -modi \\"run,window\\"" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:%s/'<,'>s/href="\([^"]*\)"/href="{{ url_for('static', filename='\1') }}"/g | |
copy from minibuffer with C-x h + M-w (https://emacs.stackexchange.com/a/37181) | |
paste with C-y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[12pt, a4paper]{article} | |
\usepackage[utf8]{inputenc} | |
\usepackage[brazilian]{babel} % Hifenização e dicionário | |
\usepackage[left=3.00cm, right=2.00cm, top=3.00cm, bottom=2.00cm]{geometry} | |
\usepackage{enumitem} % Para itemsep etc | |
\usepackage{longtable} % Dependência do longtabu | |
\usepackage{tabu} % Para melhor criação de tabelas | |
\usepackage{listings} % Para códigos | |
\usepackage{lstautogobble} % Códigos indentados corretamente | |
\usepackage{color} % Para coloração de códigos |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import sys | |
import time | |
import rtmidi | |
import liblo | |
from rtmidi.midiutil import open_midiinput, open_midioutput | |
from PyQt5.QtWidgets import QWidget, QApplication | |
from PyQt5.QtGui import QPainter, QColor, QFont | |
from PyQt5.QtCore import Qt, QPointF, QRectF, QTimer, pyqtSlot, pyqtSignal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [] = pre1() | |
clf() | |
x = [1, zeros(1,99)] | |
y = filter([1], [1, 0.95], x) | |
plot2d3(y) | |
endfunction | |
function [] = pre2() | |
clf() | |
h = iir(10, 'lp', 'butt', 0.125, [0 0]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [magnitude, phase] = fourierSeries(x) | |
// FOURIERSERIES - Return the magnitude and phase of each | |
// sinusoidal component in the Fourier series expansion for | |
// the argument, which is interpreted as one cycle of a | |
// periodic signal. The argument is assumed to have an | |
// even number p of samples. The first returned value is an | |
// array containing the amplitudes of the sinusoidal | |
// components in the Fourier series expansion, with | |
// frequencies 0, 1/p, 2/p, ... 1/2. The second returned | |
// value is an array of phases for the sinusoidal |
NewerOlder