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
;; Closure-Creating Interpreters in Racket | |
#lang racket | |
;; expressions comprise the λ-calculus extended | |
;; to include numeric constants and the + builtin | |
(define (expr? e) | |
(match e | |
[(? number? n) #t] | |
[`(+ ,(? expr? e0) ,(? expr? e1)) #t] | |
[(? symbol? x) #t] |
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 Auto-Refresh | |
// @include https://www.example.com | |
// ==/UserScript== | |
//--- https://stackoverflow.com/questions/25484978/i-want-a-simple-greasemonkey-script-to-reload-the-page-every-minute | |
setTimeout(function(){ location.reload(); }, 20*1000); |
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
set timeout=3 | |
menuentry 'Linux diskless' --class os { | |
insmod efi_gop | |
insmod efi_uga | |
# set server from option 66 (tftp-server-name) if not exist, use next_server | |
if ! net_get_dhcp_option net_default_server ${net_default_interface} 66 string; then | |
echo ' using next_server option instead.' |
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
;; expression must already be expanded by expander | |
;; so it shall only have the following syntaxes: | |
;; - define | |
;; - lambda | |
;; - set! | |
;; - quote | |
;; - if | |
;; - begin | |
;; NB: by this point, all of the optimisation in Scheme level | |
;; must be done. (e.g. constant folding) |
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/sh | |
# | |
# msys2-sshd-setup.sh — configure sshd on MSYS2 and run it as a Windows service | |
# | |
# Please report issues and/or improvements to Sam Hocevar <sam@hocevar.net> | |
# | |
# Prerequisites: | |
# — MSYS2 itself: http://sourceforge.net/projects/msys2/ | |
# — admin tools: pacman -S openssh cygrunsrv mingw-w64-x86_64-editrights | |
# |
Moved to git repository: https://github.com/denji/golang-tls
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
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
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source. | |
# Will include all hosts the playbook is run on. | |
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html | |
- name: "Build hosts file" | |
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present | |
when: hostvars[item].ansible_default_ipv4.address is defined | |
with_items: groups['all'] |
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
import static java.lang.Math.PI; | |
import static java.lang.Math.cos; | |
import static java.lang.Math.sin; | |
import static java.lang.Math.sqrt; | |
import static javafx.scene.paint.Color.BLACK; | |
import static javafx.scene.paint.Color.BLUE; | |
import static javafx.scene.paint.Color.BROWN; | |
import static javafx.scene.paint.Color.GREEN; | |
import static javafx.scene.paint.Color.PINK; | |
import static javafx.scene.paint.Color.RED; |
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
(add-hook 'before-save-hook 'delete-trailing-whitespace) | |
;; use setq-default so modes that want tabs can enable this | |
(setq-default indent-tabs-mode nil) | |
(defun rick-sh-mode () | |
"2 space indent" | |
(interactive) | |
(setq sh-basic-offset 2 | |
sh-indentation 2)) | |
(add-hook 'sh-mode-hook 'rick-sh-mode) |
NewerOlder