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
<?php | |
/* | |
Wordpress bug https://core.trac.wordpress.org/ticket/47855 | |
When using a current PHP version, class-phpmailer.php:validateAddress() uses a complex regex ("pcre8") for email address validation. | |
PHP < 7.3 uses libpcre 8.x. | |
PHP 7.3 uses libpcre2 10.x. | |
Due to a bug in libpcre2 < 10.32-RC1 https://bugs.exim.org/show_bug.cgi?id=2300, |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# A SpaCy implementation of | |
# https://github.com/Babylonpartners/fastText_multilingual | |
# | |
# heavily based on | |
# https://github.com/Babylonpartners/fastText_multilingual/blob/master/align_your_own.ipynb | |
import numpy as np |
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
;;; js-beautify.el -- beautify some js code | |
(defgroup js-beautify nil | |
"Use jsbeautify to beautify some js" | |
:group 'editing) | |
(defcustom js-beautify-args "--jslint-happy --brace-style=end-expand --keep-array-indentation" | |
"Arguments to pass to jsbeautify script" | |
:type '(string) | |
:group 'js-beautify) |
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
;; This function replaces all words in a buffer with words of the same length, | |
;; chosen at random from /usr/share/dict/words. Words are replaced consistently, | |
;; so e.g. "A" is always replaced with "Z". The mapping changes when Emacs is | |
;; restarted or when the cache buffer is killed. If all unique words of a certain | |
;; length are exhausted, random strings are used. | |
(defun ap/replace-words-randomly (&optional buffer) | |
"Replace all words in BUFFER or current buffer with randomly selected words from the dictionary. | |
Every time a new word is found, it is mapped to a replacement | |
word, so every instance of word A will be replaced with word Z." |
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 | |
run () { | |
signal-desktop & | |
disown | |
} | |
show () { | |
local -r id="$1" | |
idx="$(printf "0x%08x" "${id}")" |
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
#! /usr/bin/python2 | |
import gtk.gdk | |
w = gtk.gdk.window_foreign_new( gtk.gdk.get_default_root_window().property_get("_NET_ACTIVE_WINDOW")[2][0] ) | |
w.set_decorations( (w.get_decorations()+1)%2 ) # toggle between 0 and 1 | |
gtk.gdk.window_process_all_updates() | |
gtk.gdk.flush() | |
# now bind this to super-r or something |
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
## derived from http://stackoverflow.com/questions/994563/integrate-readlines-kill-ring-and-the-x11-clipboard | |
## You need to choose which clipboard to integrate with, OS X or X11: | |
shell_copy() { | |
pbcopy # OS X | |
# or ssh user@remote_mac pbcopy | |
# or xclip | |
} | |
shell_yank() { |
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 | |
mkdir /tmp/curl-ca-bundle | |
cd /tmp/curl-ca-bundle | |
wget http://curl.haxx.se/download/curl-7.22.0.tar.bz2 | |
tar xzf curl-7.22.0.tar.bz2 | |
cd curl-7.22.0/lib/ | |
./mk-ca-bundle.pl | |
if [ ! -d /usr/share/curl/ ]; then | |
sudo mkdir -p /usr/share/curl/ | |
else |
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
Question Real Guess Correct? RelErr Digits | |
What is 18857 - 592? 18265 18265 Yes 0.0% 5/5 | |
What is 30752 - 3087? 27665 27365 No 1.1% 4/5 | |
What is 2241 + 19873? 22114 22114 Yes 0.0% 5/5 | |
What is 5412 + 10169? 15581 15581 Yes 0.0% 5/5 | |
What is 11831 - 9178? 2653 3153 No 18.8% 2/4 | |
What is 1701 * 19933? 33906033 33953373 No 0.1% 4/8 | |
What is 11648 + 17851? 29499 30509 No 3.4% 1/5 | |
What is 29253 - 6202? 23051 22151 No 3.9% 3/5 | |
What is 27365 + 24989? 52354 53554 No 2.3% 3/5 |
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 | |
if test -f .merlin; then | |
echo ".merlin already exists, bailing out ..." >&2 | |
exit 1 | |
else | |
# You could add your default EXT's and such to this list: |