This file contains 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
// ==UserScript== | |
// @name unfix-all-the-toolbars | |
// @description Removes "position: fixed" style from elements, unfixing "toolbars" and the such. | |
// @namespace http://inf.ufrgs.br/~vbuaraujo/ | |
// @include * | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
This file contains 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
// SmallLisp: a simple Lisp-like language shell implemented in C++. | |
#include <iostream> | |
#include <sstream> | |
#include <memory> | |
#include <map> | |
#include <list> | |
#include <cctype> | |
#include <exception> |
This file contains 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
;; scgi.scm - An example SCGI server in Guile. | |
;; SCGI (https://en.wikipedia.org/wiki/Simple_Common_Gateway_Interface) is a | |
;; protocol for web servers (such as Apache and NGINX) to communicate with | |
;; application servers. The idea is similar to CGI, but instead of the server | |
;; running a new process with your application for each request, the | |
;; application runs continuously as an SCGI server, and the web server passes | |
;; requests to it (via a TCP port, or a Unix domain socket, for example). For | |
;; each request, the application sends a response back to the web server, | |
;; which will then get served to the client. |
This file contains 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
#!/bin/bash | |
# vpnsetup.sh - Set up a L2TP VPN on Debian/Ubuntu systems. | |
# Written by Vítor De Araújo <https://elmord.org/>. | |
# Version 1.2, 2018-08-23. | |
# Location where the VPN control script will be installed. | |
VPNCTL_SCRIPT=/usr/local/bin/vpn | |
# Am I bash? |
This file contains 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
// ==UserScript== | |
// @name Unfix all toolbars! | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
function unfix(el) { | |
if (["fixed", "sticky"].indexOf(window.getComputedStyle(el).position) >= 0) { | |
if (el.offsetWidth >= document.documentElement.clientWidth) { | |
console.log("Unfix element:", el); |
This file contains 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
(defun elmord-block-comment-auto-prefix () | |
(when (eq last-command-event ?\n) | |
(let* ((last-comment-start | |
(save-excursion (search-backward "/*" nil t))) | |
(last-comment-end | |
(save-excursion (search-backward "*/" last-comment-start t)))) | |
(when (and last-comment-start (not last-comment-end)) | |
(insert "* ") | |
(indent-for-tab-command))))) |
This file contains 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
;;;; init-exwm.el -*- lexical-binding: t; -*- | |
(require 'exwm) | |
;; (require 'exwm-config) | |
;; Commented out because I'm using stalonetray instead of the EXWM tray. | |
;; (require 'exwm-systemtray) | |
;; (exwm-systemtray-enable) | |
;; (exwm-config-default) |
This file contains 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
(define-syntax switch | |
(syntax-rules (default) | |
[(switch expr clauses ...) | |
(let ([result expr]) | |
(%handle-switch-clauses result clauses ...))])) | |
(define-syntax %handle-switch-clauses | |
(syntax-rules (default) | |
[(_ result) 'Nada™] | |
[(_ result (default forms ...)) (begin forms ...)] |
This file contains 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
#!/bin/bash | |
main() { | |
if [[ $INSIDE_NETCAT ]]; then | |
serve_request | |
else | |
export INSIDE_NETCAT=1 | |
while :; do | |
netcat -q 0 -v -l -p 9000 -c "$0" | |
done |
This file contains 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
;;;; Search. | |
;; Automatically wrapping I-search. | |
;; https://stackoverflow.com/questions/285660/automatically-wrapping-i-search | |
;; TODO: Still not perfect: does not distinguish overwrapped I-search anymore. | |
(defadvice isearch-search (after isearch-no-fail activate) | |
(unless isearch-success | |
;; Avoid recursive loop | |
(ad-disable-advice 'isearch-search 'after 'isearch-no-fail) | |
(ad-activate 'isearch-search) ;; ad-activate to reflect the above change |
NewerOlder