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
"Show unicode identifier ranges." | |
in_identifier_range = False | |
for codepoint in range(int('10ffff', 16)): # Last mapped codepoint is U+10FFFF | |
if chr(codepoint).isidentifier() and not in_identifier_range: | |
# We are transitioning into a range. | |
in_identifier_range = True | |
start = codepoint | |
elif not chr(codepoint).isidentifier() and in_identifier_range: | |
# We are transitioning out of a range. |
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 sunset (color) | |
"Redshifts the #RRGGBB COLOR." | |
(let ((rgb | |
(mapcar | |
(lambda (x) (string-to-number x 16)) | |
(list | |
(substring color 1 3) | |
(substring color 3 5) | |
(substring color 5 7))))) | |
(concat |
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
--- | |
- name: properly name servers | |
hosts: servers | |
become_method: sudo | |
vars: | |
source: 192.168.57.1 | |
tasks: | |
- name: create hostname | |
local_action: command nsaname -h |
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 | |
function bitrate { | |
file $1 | sed 's/.*, \(.*\)kbps.*/\1/' | |
} | |
mp3file=$1 | |
if [ $(bitrate $mp3file) -gt 192 ]; then | |
echo 'I should compress this' |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>1 million obj[index] attributions #jsbench #jsperf</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>1 million map sets #jsbench #jsperf</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
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 random | |
import string | |
vowels = 'aeiouy' | |
specials = 'q' | |
consonants = [ | |
l for l in string.ascii_lowercase if l not in vowels and l not in specials] | |
consonants += ['qu', 'ch', 'sh', 'ph', 'lh', 'nh', 'tr'] | |
sillabes = [consonant + vowel for consonant in consonants for vowel in vowels] |
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
open http://www.google.com/?q=$(sysctl -n machdep.cpu.brand_string | awk '{FS=" " ; print $2 "+" $3 "+" $4}')+site:ark.intel.com | |
or, on a Linux machine | |
xdg-open http://www.google.com/?q=$(fgrep 'model name' /proc/cpuinfo | head -n 1 | awk '{FS=" " ; print $5 "+" $6}')+site:ark.intel.com |
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
apt-get update && apt-get -y dist-upgrade && apt-get install software-properties-common && apt-add-repository ppa:maas-maintainers/experimental3 | |
apt-get install maas |
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
dpkg -l maas* | cat | |
dpkg -l maas* > /tmp/dpkg-l-maas.txt | |
sudo tar jcvf /tmp/maas-logs-$(date +%Y%m%d%H%M)-$(hostname).tar.bz2 /var/log/maas/ /var/log/kern.log /var/log/syslog /tmp/dpkg-l-maas.txt |