This file contains hidden or 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
extern crate rand; | |
use std::{thread, time}; | |
use rand::Rng; | |
/* | |
RULES | |
For a space that is 'populated': | |
Each cell with one or no neighbors dies, as if by solitude. |
This file contains hidden or 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 requests, csv | |
# optional: makes requests-cache make it easy to cache your results | |
# import requests_cache | |
# requests_cache.install_cache('reddit_cache') | |
# where we store all the rows | |
DATA = [] | |
def get(url, args={}): |
This file contains hidden or 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 slugify import slugify | |
import os, shlex, sys | |
from bs4 import BeautifulSoup | |
def call(cmd): | |
code = os.system(cmd) | |
if code != 0: | |
raise Exception('"{}"" returned {}'.format(cmd, code)) | |
def call_bash(cmd): |
This file contains hidden or 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
server { | |
listen 80; | |
server_name dat_server.com; | |
client_max_body_size 1000M; | |
location / { | |
include proxy_params; | |
proxy_pass http://unix:/home/me/project/server.sock; | |
proxy_http_version 1.1; |
This file contains hidden or 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
sudo apt-get install bzr python python-vte python-psutil | |
bzr branch lp:terminator | |
./terminator # it works ! | |
hacking can begin, for example type `self.text = '<>< ' + text + ' ><>` in `WindowTitle.set_title' of `window.py` | |
then title will always begin with "<>< " |
This file contains hidden or 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 path = require('path'); | |
var webpack = require('webpack'); | |
module.exports = { | |
devtool: 'source-map', | |
entry: { | |
graph: './src/graph.js', | |
vendor: ['react', 'react-dom'], | |
}, | |
output: { |
This file contains hidden or 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 selenium import webdriver | |
import time | |
driver = webdriver.Firefox() | |
driver.get("https://www.instagram.com/p/BP-rXUGBPJa/") | |
time.sleep(2) | |
print('click click click') | |
while True: | |
link = driver.find_element_by_css_selector('._l086v') | |
link.click() |
This file contains hidden or 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
simulate roads created by people trying to get from point A to point B | |
rules: | |
- each turn, everybody is assigned a position to go if they don't have already somewhere to go | |
- each time they go over a "block", it becomes easier for others to use it |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8' /> | |
<title></title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.25.1/mapbox-gl.js'></script> | |
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.25.1/mapbox-gl.css' rel='stylesheet' /> | |
<style> | |
body { margin:0; padding:0; } |
This file contains hidden or 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 bs4 import BeautifulSoup | |
from lys import render, L | |
html_doc = """ | |
<ul class="breadcrumb"> | |
<li class="active">Home</li> | |
</ul> | |
<ul class="breadcrumb"> | |
<li><a href="#">Home</a></li> |