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
#!/usr/bin/env pypy | |
from random import randint as r | |
class Universe(list): | |
def __init__(self, x, y): | |
for num in range(x): | |
self.append([False for num in range(y)]) | |
self.xlen = len(self) | |
self.ylen = len(self[0]) | |
self.cardinals = self.north, self.north_east, self.north_west, self.west,\ |
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 gol import Universe as U | |
from random import randint as r | |
import pygame | |
from pygame.gfxdraw import pixel as p | |
from pygame.gfxdraw import rectangle as rect | |
from pygame import Surface as S | |
# just shoved everything in this script into main(), hence the subfuncs | |
def main(): | |
x, y = 100, 100 |
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 gol import Universe as U | |
import pyglet | |
# too lazy to make into a class, just pulled all functions under pyglet_way() | |
def pyglet_way(): | |
x, y = 150, 150 | |
u = U(x, y) |
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 the modules""" | |
In [1]: from OKQuestions import OKQuestions as OKQS | |
In [2]: from bs4 import BeautifulSoup as BS | |
In [3]: from OKSession import OKSession as OKS | |
In [4]: from OKProfile import OKProfile as OKP |
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
In [26]: import requests | |
In [27]: import bs4 | |
In [29]: url = "http://www.yellowpages.com/raleigh-nc/wake-med-hospital" | |
In [30]: response = requests.get(url) | |
In [31]: bs_content = bs4.BeautifulSoup(response.content) |
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 functools import lru_cache | |
from lxml.html import HtmlElement, Element, fromstring | |
from lxml.etree import XPath | |
from bs4 import BeautifulSoup, Tag | |
class BeauToLxml(object): | |
""" | |
An adapter for a small subset of the BeautifulSoup4 API |
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 functools import lru_cache | |
from lxml.html import HtmlElement, fromstring | |
from lxml.etree import XPath | |
BS4_TYPES = "bs4.element.Tag", "bs4.BeautifulSoup" | |
class HtmlWrapper(object): |
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
Ansible playbook to setup HTTPS using Let's encrypt on nginx. | |
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS. | |
The server pass A rating on [SSL Labs](https://www.ssllabs.com/). | |
To use: | |
1. Install [Ansible](https://www.ansible.com/) | |
2. Setup an Ubuntu 16.04 server accessible over ssh | |
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain | |
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder) |
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 Pinterest Autounfollow | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Autofollow | |
// @author Alex DeLorenzo | |
// @match https://www.pinterest.com/organicallergyr/following | |
// @match https://www.pinterest.com/organicallergyr/following/* | |
// @require http://code.jquery.com/jquery-latest.js | |
// @grant none |
OlderNewer