Skip to content

Instantly share code, notes, and snippets.

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

Anthony Nixon AnthonyNixon

🆗
‌‌ 200
View GitHub Profile
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define PINLEFT 15
#define PINRIGHT 13
#define OUTSIDE_START 0
#define OUTSIDE_END 23
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define PINLEFT 15
#define PINRIGHT 13
#define OUTSIDE_START 0
#define OUTSIDE_END 23
@AnthonyNixon
AnthonyNixon / 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
@AnthonyNixon
AnthonyNixon / check_mentions.py
Last active May 23, 2017 02:31
This is the code behind @BeeMovieByWord. When someone tweets at @BeeMovieByWord, it will respond with a word from the script.
#!/usr/bin/python
from twitter import *
import os, json, re
with open('persistence.json') as data_file:
metadata = json.load(data_file)
data_file.close()
with open('script.txt') as script_file:
script_words = script_file.readlines()
@AnthonyNixon
AnthonyNixon / 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
@AnthonyNixon
AnthonyNixon / 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):
@AnthonyNixon
AnthonyNixon / 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)
Mr. Speaker, Mr. Vice President, Members of Congress, the First Lady of the United States, and Citizens of America:
Tonight, as we mark the conclusion of our celebration of Black History Month, we are reminded of our Nation's path toward civil rights and the work that still remains. Recent threats targeting Jewish Community Centers and vandalism of Jewish cemeteries, as well as last week's shooting in Kansas City, remind us that while we may be a Nation divided on policies, we are a country that stands united in condemning hate and evil in all its forms.
Each American generation passes the torch of truth, liberty and justice --- in an unbroken chain all the way down to the present.
That torch is now in our hands. And we will use it to light up the world. I am here tonight to deliver a message of unity and strength, and it is a message deeply delivered from my heart.
A new chapter of American Greatness is now beginning.
A new national pride is sweeping across our Nation.
And a new surge of optimism is placing
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: