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 | |
if [ `id -u` -ne 0 ]; then | |
echo "Rippling uninstall must be run by root" | |
exit 1 | |
fi | |
sudo launchctl unload /Library/LaunchDaemons/com.rippling.* | |
sudo rm -rf /Library/LaunchDaemons/com.rippling.* | |
sudo rm -rf /opt/rippling |
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 random import * | |
# lock the results for reproducibility | |
seed(1) | |
# Staff of shadow flame is estimated to be between 7-8% | |
drop_rate = .075 | |
# Total players who are competing | |
pool_size = 3 |
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
# What's the best guess? | |
tm = float(input("Most probable Time (Tm) = ")) | |
# If everything goes well, how long would it take? | |
to = float(input("Optimistic Time (To) = ")) | |
# If everything bad happens, how long would it take? | |
# Probable time | |
tp = float(input("Pessimistic Time (Tp) = ")) |
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
/var/app/weather-10kb/src/modules/WeatherRequest.js:18 | |
timezone.key(process.env.GOOGLE_TIMEZONE_API_KEY); | |
^ | |
TypeError: timezone.key is not a function | |
at Object.<anonymous> (/var/app/weather-10kb/src/modules/WeatherRequest.js:18:10) | |
at Module._compile (module.js:624:30) | |
at Object.Module._extensions..js (module.js:635:10) | |
at Module.load (module.js:545:32) | |
at tryModuleLoad (module.js:508:12) |
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 csv | |
org_data = open("data2.csv") | |
data_alpha, data_beta, org_first_seen = list(), list(), list() | |
with open('data2.csv', 'rb') as csvfile_A: | |
csvfile_A = csv.reader(csvfile_A) | |
for item in csvfile_A: |
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
function click_input_items() { | |
matching_inputs = document.querySelectorAll('input[value="Delete"]'); | |
matching_inputs.forEach((ele)=>{ | |
setInterval(function(){ele.click()}, 100); | |
}) | |
} | |
click_input_items() |
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
# change change password, keyboard layout, enable ssh, enable wifi | |
sudo raspi-config | |
# update | |
sudo apt-get update | |
# install git | |
sudo apt-get install git -y | |
# vim |
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
# time how long a function takes | |
import timeit | |
def display_numbers(): | |
for i in range(1000): | |
print(i) | |
print(timeit.timeit(stmt=display_numbers, number=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 hashlib | |
from hashlib import blake2b | |
log_file = open("ip_addresses.txt", "r").read().splitlines(); | |
new_file = open("new.csv", 'w') | |
for line in log_file: | |
h = blake2b(key=b'secret_key_change_this!', digest_size=10) | |
h.update((line).encode()) | |
parsed_line = h.hexdigest() |
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://fivethirtyeight.com/features/riddler-nation-goes-to-war/ | |
# http://www.bicyclecards.com/how-to-play/war/ | |
import random | |
# https://docs.python.org/3/library/random.html | |
random.seed(0) | |
# Ace is 14 | |
def deck_of_aces(): | |
return [(14,'club'),(14,'diamond'),(14,'heart'),(14,'spade')] |
NewerOlder