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
from datetime import date, timedelta | |
# http://www.voidware.com/moon_phase.htm | |
def moon_phase(y, m, d): | |
""" | |
0 => new moon | |
1 => waxing crescent | |
2 => first quarter | |
3 => waxing gibbous | |
4 => full moon |
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
Random, upper, 0, 1 | |
ToggleCase(c) { | |
global upper := !upper | |
if upper { | |
StringUpper, c, c | |
} else { | |
StringLower, c, c | |
} |
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
// Run in developer console | |
// var likes = document.getElementsByClassName('UFILikeLink _4x9_'); // Just for posts | |
var likes = document.getElementsByClassName('UFILikeLink'); // For all likes | |
(function clicker (links) { | |
setTimeout(() => { | |
links[0].click(); | |
if (links.length > 1) { | |
clicker(links.slice(1)); |
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
use std::collections::HashMap; | |
use std::env; | |
use std::fs::File; | |
use std::io::{self, prelude::*, BufReader}; | |
use std::process; | |
fn tokenize(letters: &str) -> HashMap<char, u8> { | |
let mut map = HashMap::new(); | |
for c in letters.chars() { | |
*map.entry(c).or_default() += 1; |
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 argparse | |
import os | |
from PIL import Image | |
parser = argparse.ArgumentParser( | |
description='Convert GIF into frames and then create ' | |
'AnimatedTexture .tres') | |
parser.add_argument('gif', help='GIF to process') | |
args = parser.parse_args() |
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 python | |
from collections import Counter | |
import fileinput | |
counter = Counter() | |
for line in fileinput.input(): | |
counter.update(c for c in set(line) if c.isalpha()) | |
print(counter) |
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
From: https://www.reddit.com/r/programming/comments/8jjq33/11_best_programming_fonts/dz0xxs5/ | |
------ | |
o0O s5S z2Z !|l1Iij {([|})] .,;: ``''"" | |
a@#* vVuUwW <>;^°=-~ öÖüÜäÄßµ \/\/ | |
the quick brown fox jumps over the lazy dog | |
THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG | |
0123456789 &-+@ for (int i=0; i<j; ++i) { } |
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
; https://www.autohotkey.com/docs/commands/SoundSet.htm#Ex | |
F13:: | |
MIC_ID = 7 | |
SoundSet, +1, MASTER, mute, %MIC_ID% | |
SoundGet, master_mute, , mute, %MIC_ID% | |
Msg := "Microphone online" | |
Action := "Insert" | |
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 platform | |
import re | |
import subprocess | |
from statistics import mean | |
def pings(*, url='google.com', count=10): | |
if platform.system() == 'Windows': | |
flag = '-n' | |
else: | |
flag = '-c' |
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
$rl = Get-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 252950" | |
$uninstall = $rl.UninstallString.Replace('"', '') | |
Invoke-Expression $uninstall |
NewerOlder