Visit my blog or connect with me on Twitter
git init
or
Visit my blog or connect with me on Twitter
git init
or
| # if there is a clock skew detected, run: | |
| # find /your/dir -type f -exec touch {} + | |
| CXX := g++ | |
| CXXSTD := -std=c++11 | |
| CXXFLAGS := -Wall -Wextra -O2 | |
| SRCDIR := src | |
| BUILDDIR := build | |
| TARGET := bin/a.out |
| def generate_hex_string(length: int): | |
| """ Generate a randomized hex string. | |
| Parameters | |
| ---------- | |
| length : int | |
| Desired character length of the returned token. | |
| Returns | |
| ------- |
| from queue import Queue | |
| from threading import Thread, Lock | |
| from itertools import product | |
| from string import ascii_lowercase | |
| import requests | |
| usrs = [''.join(i) for i in product(ascii_lowercase + '-', repeat = 3)] | |
| usrs = [x for x in usrs if (not x.startswith('-')) and (not x.endswith('-'))] | |
| class Worker(Thread): |
| import dbus | |
| import time | |
| session_bus = dbus.SessionBus() | |
| spotify_bus = session_bus.get_object("org.mpris.MediaPlayer2.spotify", | |
| "/org/mpris/MediaPlayer2") | |
| spotify_properties = dbus.Interface(spotify_bus, | |
| "org.freedesktop.DBus.Properties") | |
| #include <iostream> | |
| #include <fstream> | |
| #include <cstdlib> | |
| #include <ctime> | |
| int main(int argc, char** argv) | |
| { | |
| int time_initial = 0, | |
| time_final = 0, |
| /* | |
| ** Game designed according to this challenge: | |
| ** https://www.reddit.com/r/dailyprogrammer/comments/3qjnil/20151028_challenge_238_intermediate_fallout/ | |
| */ | |
| /* | |
| ************************************************************ | |
| // HEADER FILES | |
| ************************************************************ | |
| */ |
| /* | |
| * Title: Spartan vs. Skeletons | |
| * Author: Sean Pianka | |
| * Date: November 3rd, 2015 | |
| * Description: A game where spartans and skeletons fight! Idea from | |
| * YouTube channel "MakingGamesWithBen" and his first challenge video! | |
| The game is based off of this tutorial, which I highly recommend to | |
| anyone looking to get into programming and game development: | |
| # Remove useless programs to free up space | |
| sudo apt-get remove --purge -y wolfram* libreoffice* sonic-pi minecraft-pi | |
| sudo apt-get clean && sudo apt-get autoremove | |
| # Update, upgrade, and install all OpenCV dependencies | |
| sudo apt-get update -y && sudo apt-get upgrade -y | |
| sudo apt install libgdk-pixbuf2.0-dev libpango1.0-dev libcairo2-dev libfontconfig1-dev libgdk-pixbuf2.0-dev libpango1.0-dev libcairo2-dev # GTK requires | |
| sudo apt-get install build-essential cmake pkg-config libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libgtk2.0-dev libgtk-3-dev libatlas-base-dev gfortran python2.7-dev python3-dev # opencv requires | |
| # virtualenv for Python, this is where OpenCV will be installed | |
| sudo pip install virtualenv virtualenvwrapper | |
| PROJECT_HOME=$HOME/Development |