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/python3 | |
'''Gnome desktop background settings.''' | |
from subprocess import run | |
from os import listdir | |
from datetime import datetime | |
WALLPAPERS = listdir('/home/foo/Pictures/Wallpapers') | |
D = {} |
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 python | |
'''Generate gradient chart.''' | |
N = 16 | |
def gen_gradient(): | |
'''Generate gradient.''' | |
global N | |
f_str = f'' |
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 python | |
'''Generate random colored background design.''' | |
from random import randrange | |
def generate_design(): | |
'''Generate random background design.''' | |
print('\x1b[1;34mEnter hex color\x1b[0m: (example: 50514f) or leave blank') | |
hex1 = input('hex 1: ').upper() or '000000' | |
hex2 = input('hex 2: ').upper() or '000000' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Bar Chart: Fibonacci</title> | |
</head> | |
<body> | |
<!-- bar chart --> | |
<div><embed src={{ chart|safe }} /></div> | |
</body> |
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 python | |
'''`simple_gematria_converter` module contains `convert()` method which \ | |
converts letters to simple gematria values.''' | |
def convert(): | |
'''Convert alphabetical characters to numerological integers.''' | |
char_num = { | |
'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, | |
'h': 8, 'i': 9, 'j': 10, 'k': 11, 'l': 12, 'm': 13, 'n': 14, | |
'o': 15, 'p': 16, 'q': 17, 'r': 18, 's': 19, 't': 20, 'u': 21, | |
'v': 22, 'w': 23, 'x': 24, 'y': 25, 'z': 26, ' ': ' ' |
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
#! /bin/python3 | |
'''Given string, convert characters to hexadecimal, binary, hexadecimal and \ | |
base64 values. Script available under MIT license: opensource.org/licenses/MIT''' | |
from base64 import b64encode as b64 | |
def convert_chars(): | |
'''Convert characters to hexadecimal, binary, hexadecimal and base64 \ | |
values.''' | |
chr_keys = { |
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 python3 | |
'''Convert characters to similar, random UTF-8 characters.''' | |
from random import randrange | |
def substitute(): | |
'''Given text string, `substitute()` method substitutes characters.''' | |
char_dict = { | |
'a': ['à', 'á', 'â', 'ã', 'ä', 'å', 'ā', 'ă', 'ȃ', 'ą', 'ǎ', 'ȁ', 'ȧ', | |
'ɑ', 'ά'], | |
'A': ['À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Ā', 'Ă', 'Ȃ', 'Ą', 'Ǎ', 'Ȁ', 'Ȧ', |
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
#! /bin/nodejs | |
function addBitwise (a, b) { | |
// if `a` = `3` and `b` = `2` | |
let c = 0; // carry over | |
// loop while `b` is not equal to zero | |
while (b !== 0) { | |
// first iteration | |
c = a & b; // bitwise AND: 3/0011 AND 2/0010 --> 2/0010 | |
a ^= b; // bitwise XOR: 3/0011 XOR 2/0010 --> 1/0001 |
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
#! /bin/nodejs | |
function countInversions(a) { | |
var count = 0 | |
for (let i=0; i<a.length; ++i) { | |
for (let j=i+1; j<a.length; ++j) { | |
if (a[i] > a[j]) { | |
count++ | |
} | |
} |