Skip to content

Instantly share code, notes, and snippets.

View Niximacco's full-sized avatar
🆗
‌‌ 200

Anthony Niximacco Niximacco

🆗
‌‌ 200
  • GiddyUp
  • Minneapolis, Minnesota
  • 18:38 (UTC -06:00)
View GitHub Profile
@Niximacco
Niximacco / playSound.APPLESCRIPT
Created July 20, 2017 03:46
Applescript to raise volume, play audio file, and revert volume back to its previous level.
set previousVolume to output volume of (get volume settings)
set volume output volume 80
do shell script "afplay " & "~/inception.mp3"
set volume output volume previousVolume
@Niximacco
Niximacco / cloneAll.py
Last active May 5, 2017 05:25
Clones all repositories a user owns into the current directory
#!/usr/bin/python
import os
import urllib2
import json
import sys
import time
import subprocess
from subprocess import call
@Niximacco
Niximacco / same_birthday.py
Created April 18, 2017 05:10
Same Birthday Script
import random
num_people = 100
num_trials = 10000
for personCount in range(2,num_people+1):
trial_success = 0
for trialCount in range(0, num_trials):
birthdays = []
for person in range(0, personCount):
@Niximacco
Niximacco / Simple_TCP_Server.py
Last active March 15, 2017 16:35
Starts a simple tcp server with python.
import socket
import sys
HOST = '0.0.0.0' # Symbolic name meaning the local host
PORT = int(sys.argv[1]) # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)
According to all known laws of aviation, there is no way a bee should be able to fly.
Its wings are too small to get its fat little body off the ground.
The bee, of course, flies anyway because bees don't care what humans think is impossible.
Yellow, black. Yellow, black. Yellow, black. Yellow, black.
Ooh, black and yellow!
Let's shake it up a little.
Barry! Breakfast is ready!
Coming!
Hang on a second.
Hello?
#!/usr/bin/python
import re
with open('script', 'r') as scriptfile:
script=scriptfile.read()
bottles = []
currentString = ""
for c in script:
['According to all', 'known laws of', 'aviation, there is', 'no way a bee', 'should be able to', 'fly. Its wings are', 'too small to get', 'its fat little', 'body off the', 'ground. The bee,', 'of course, flies', 'anyway because', "bees don't care", 'what humans think', 'is impossible.', 'Yellow, black.', 'Yellow, black.', 'Yellow, black.', 'Yellow, black.', 'Ooh, black and', "yellow! Let's", 'shake it up a', 'little. Barry!', 'Breakfast is', 'ready! Ooming!', 'Hang on a second.', 'Hello? Barry?', 'Adam? Oan you', 'believe this is', 'happening? I', "can't. I'll pick", 'you up. Looking', 'sharp. Use the', 'stairs. Your', 'father paid good', 'money for those.', "Sorry. I'm", "excited. Here's", 'the graduate.', "We're very proud", 'of you, son. A', 'perfect report', "card, all B's.", 'Very proud. Ma! I', 'got a thing going', 'here. You got lint', 'on your fuzz. Ow!', "That's me! Wave to", "us! We'll be in", 'row 118,000. Bye!', 'Barry, I told you,', 'stop flying in the', 'house! Hey, Adam.', 'Hey, Barry. Is', 't
rm -r backups/*
mysqldump -u root --password <PASSWORD_HERE> --all-databases > backups/backup-$(date -d "today" +"%Y-%m-%d-%H%M").sql
gsutil cp backups/* gs://<BUCKET HERE>