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 Hide Tweet Views | |
// @version 0.1 | |
// @description Hide view count in twitter timeline | |
// @author Snep | |
// @match https://twitter.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com | |
// @grant none | |
// ==/UserScript== |
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
public static void walkDirectory(File file) { | |
int levels = file.getAbsolutePath().length() - file.getAbsolutePath().replace(File.separator, "").length(); | |
try { | |
Files.walk(file.toPath()).map(Path::toFile).forEach((File f) -> { | |
int subLevels = f.getAbsolutePath().length() - f.getAbsolutePath().replace(File.separator, "").length() | |
- levels; | |
String indent = new String(new char[(subLevels) * 4]).replace('\0', ' '); | |
System.out.println(indent + f.getName() + (f.isDirectory() ? ":" : "")); | |
}); | |
} catch (IOException e) { |
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 math import sqrt | |
from random import randrange | |
# check if two numbers are coprime (share no common factors other than 1) | |
def is_coprime(m, n): | |
for i in range(2, int(sqrt(min(m, n))) + 1): | |
if (m % i == 0 and n % i == 0): | |
return False | |
return True |
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 discord | |
import asyncio | |
############################################################################# | |
# Configuration # | |
############################################################################# | |
# NOTE: you need to install discord.py and have Python 3.5.2 | |
# discord.py: https://github.com/Rapptz/discord.py | |
# python: https://www.python.org/downloads/ (3.5.2) |