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 time import sleep | |
from os import system | |
""" | |
After spending the day trying to understand this algorithm, i decided to animated it in terminal. | |
Makes a lot more sense, so sharing. | |
""" | |
delay = .05 |
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
<html> | |
<head> | |
<style> | |
@import 'https://fonts.googleapis.com/css?family=Roboto:300,400,500'; | |
header { | |
background-color: #263d36; | |
background-image: url("https://images.unsplash.com/photo-1511878587934-516d7ca5465b?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1689&q=80"); | |
background-position: center top; | |
background-repeat: no-repeat; |
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 boto3 | |
from fabric.api import sudo, task, env | |
import os | |
env.key_filename = os.path.expanduser('~/.ssh/key.pem') | |
env.user = 'ubuntu' | |
env.filter = ['running', 'stopped'] | |
ec2 = boto3.resource('ec2') |
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
#!/bin/bash | |
# we are supposed to be in our home directory | |
cd | |
# we make a directory called foo | |
mkdir foo | |
# we "cd" into foo, but we remember where we came from | |
pushd foo |
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
######################################################### | |
# This should print out how many USDT have been printed # | |
# date created: 22/08/2018 # | |
# date updated: 22/08/2018 # | |
######################################################### | |
import requests | |
import os | |
import json | |
import tempfile |
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 tornado import gen, web, ioloop, httpclient | |
import json | |
class MainHandler(web.RequestHandler): | |
@gen.coroutine | |
def get(self): | |
http_client = httpclient.AsyncHTTPClient() | |
time, ip, headers = yield [http_client.fetch("http://time.ioloop.io?format=json"), | |
http_client.fetch("http://ip.ioloop.io?format=json"), |
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 tornado import gen, web, ioloop, httpclient | |
import json | |
class MainHandler(web.RequestHandler): | |
@gen.coroutine | |
def get(self): | |
http_client = httpclient.AsyncHTTPClient() | |
time, ip, headers = yield [http_client.fetch("http://time.ioloop.io?format=json"), |
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 python | |
import requests | |
from argparse import ArgumentParser | |
import pickle | |
limit = 50 | |
# getting urls and dumping them into file | |
def get_urls(): | |
sites = requests.get("http://readthedocs.org/api/v1/project/?limit=%s&offset=0&format=json" % limit) | |
objects = sites.json()['objects'] |