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 # External dependency | |
from tqdm import tqdm # External dependency | |
import json | |
username = "[email protected]" | |
apikey = "abcdefghijklmnopqrstuvwxyz01234567890123" | |
baseurl = "http://something.compute-1.amazonaws.com" | |
urlsuffix = f"?format=json&email={username}&api_key={apikey}" |
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
# Preview your column widths easier with regex101.com -- makes it so much easier | |
from collections import OrderedDict | |
headers = OrderedDict([ | |
("id", 5), | |
("name", 25), | |
("attribute", 8) | |
]) | |
myregex = "" |
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> | |
<body onload="dosomething()"> | |
<center> | |
<font size="30">On Feb. 6, XOofXOs wrote:</font><br clear> | |
<blockquote class="twitter-tweet" data-conversation="none" data-lang="en"><p lang="en" dir="ltr">THIS YEAR</p>— I'm YOUR XO (@XOofXOs) <a href="https://twitter.com/XOofXOs/status/1093260909219381248?ref_src=twsrc%5Etfw">February 6, 2019</a></blockquote> | |
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> | |
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> | |
<body onload="dosomething()"> | |
<p id="demo"></p> | |
<script> | |
function dosomething() { | |
var newdate = new Date(); | |
var now = newdate.getTime(); |
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 | |
import csv | |
import re | |
hosturl = "http://app.ntsb.gov/aviationquery/Download.ashx?type=csv" | |
targetraw = "ntsbdb.raw" | |
targetcsv = "ntsbdb.csv" | |
r = requests.get(hosturl) |
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
Burn git to the ground, keep only latest commit, shrink size: | |
# Adapted from https://stackoverflow.com/questions/9683279/make-the-current-commit-the-only-initial-commit-in-a-git-repository | |
git checkout --orphan newBranch | |
git add -A # Add all files and commit them | |
git commit | |
git branch -D master # Deletes the master branch | |
git branch -m master # Rename the current branch to master | |
git gc --aggressive --prune=all # remove the old files | |
git push -u -f origin master # Force push master branch to github | |
git gc --aggressive --prune=all # remove the old files |
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
Reading list from Sasha Maggio | |
?? author, possibly TASS? 2016-12-10, ArmyRecognition.com | |
Analysis Russian Afganit active protection system is able to intercept uranium tank ammunition TASS 11012163 | |
https://www.armyrecognition.com/weapons_defence_industry_military_technology_uk/analysis_russian_afganit_active_protection_system_is_able_to_intercept_uranium_tank_ammunition_tass_11012163.html | |
Kyle Mizokami, 2017-11-01, The National Interest | |
Here Is How Russia Is Making Old Tanks Deadly Tools of War | |
https://nationalinterest.org/blog/the-buzz/here-how-russia-making-old-tanks-deadly-tools-war-22995 |
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
Highlight the long ugly bit of code that starts with "javascript" and ends with an ungodly mess of punctuation marks. | |
Hit Control-C to copy. | |
javascript:(function(){var thingyfeedurl = new URLSearchParams(__gh__coreData.pageData.buckets[0].feedURL).get('lopenr');var thingyimgurl = document.querySelectorAll('meta[property="og:image"]')[0].content.split('/AR-')[1].split(".jpg")[0];var thingymessage = "Story ID may be: " + thingyfeedurl;if(thingyimgurl != thingyfeedurl){thingymessage += "\r\nBut could be: " + thingyimgurl};if(window.location.href.split("/")[3].toLowerCase()=="zz"){thingymessage+="\r\nMake sure you look under site code ZZ with that ID"};alert(thingymessage);})(); | |
Now you need to make a new bookmark. | |
In Chrome: Control-Shift-O (like Oscar). Three dots in top-left corner; New bookmark. For name of bookmark, try, whatever, "Find NCC story ID" or something. For URL, click in the box and hit Control-V to paste. Once you have the bookmark you can drag it to your bookmark bar, if you use one. |
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
My Python initial setup: | |
python -m pip install --upgrade pip | |
Is it sqwaking about managed configuration? If you're on Unix and feeling dumb: | |
cd /.config | |
mkdir pip | |
cd pip | |
nano pip.conf | |
... | |
Add this: |
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
def timestamp(): | |
import datetime | |
return(datetime.datetime.strftime(datetime.datetime.now(), "%Y-%m-%dT%H:%M:%S")) |