openpgp4fpr:C70D98C80C6F4A7FB4A8CC6D5DED1B0FE6F13374
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
! 2023-03-30 https://www.youtube.com | |
www.youtube.com###secondary | |
www.youtube.com##.ytd-popup-container.style-scope > .yt-mealbar-promo-renderer.style-scope | |
www.youtube.com###comments > .ytd-comments.style-scope | |
www.youtube.com###actions | |
www.youtube.com###subscribe-button > .ytd-watch-metadata.style-scope | |
! 2023-04-01 https://www.theguardian.com | |
www.theguardian.com##body > .dcr-1uyetce | |
www.theguardian.com##main > .dcr-v339xn |
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
BEGIN MESSAGE. | |
gnXvwmSxwM9nDQY 6wQ0wgkEAMtRn1B 8gZHsOpAs8O09Af bbQW6dUqGEWpPT4 | |
olQ3eL4ub5vEAsP eQVBjkLJSSNTCKq 6Xr2MZHgg4cAxZ3 xGkRmNk1xNLoRNk | |
ArYOC4c44CCQvgd ZdKEsIaBTwqJaV1 0XbOp0OoYtB8QuL kPyqSfNCfRHyLPC | |
8BrwHFbhag1VAwy 0OvLQs5T0rhkyWp uwoxJ0Qz5Z. | |
END MESSAGE. |
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
-- Extension of answer by Tarleb on Stackoverflow (https://stackoverflow.com/a/52131435/3888000) to include docx section ends with portrait/landscape orientation changes. | |
-- Also uses officer package syntax to create sections breaks | |
local function newpage(format) | |
if format == 'docx' then | |
local pagebreak = '<w:p xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\"><w:r><w:br w:type="page"/></w:r></w:p>' | |
return pandoc.RawBlock('openxml', pagebreak) | |
else | |
return pandoc.Para{pandoc.Str '\f'} | |
end |
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
#!/usr/bin/env python | |
from pony.orm import Database, Optional, Required, Set | |
db = Database() | |
@db.on_connect(provider="sqlite") | |
def pragmas(db, connection): | |
cursor = connection.cursor() | |
cursor.execute('PRAGMA foreign_keys = true') |
Just a note-to-self to prevent me from reinventing the wheel again.
A shuffle that always produces a predictable output.
e.g.
>>> x = [0,1,2,3,4,5,6,7,8,9]
>>> dshuffle(x)
[7, 8, 1, 5, 3, 4, 2, 0, 9, 6]
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 pandas as pd | |
from sqlalchemy import create_engine | |
from sqlalchemy.sql import text as sql_text | |
from collections import defaultdict | |
with open('/Users/jklinger/Nesta-AWS/AWS-RDS-config/open-academic-graph.config') as f: | |
host, port, database, user, password = f.read().split(':') | |
database_uri = 'postgresql://{}:{}@{}/{}'.format(user, password, host, "microsoft_academic_graph") | |
con = create_engine(database_uri) |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
function sign(input, password) { | |
// salt should be Uint8Array or ArrayBuffer | |
var saltBuffer = str2ab('e85c53e7f119d41fd7895cdc9d7bb9dd'); | |
// don't use naive approaches for converting text, otherwise international | |
// characters won't have the correct byte sequences. Use TextEncoder when | |
// available or otherwise use relevant polyfills |
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
BEGIN MESSAGE. | |
pNDvwhystUSfREk 6CZlgP5pDbEthDx kgJ3uLpwjCHE6L5 ZkhZXiR3iEMwvdk | |
Knc3lRi7AIRtdkn f7U6NZcbzpbTCKq 6Xr2MZHgg6ZqWjy Abevu3bUnOUBioP | |
IiYKZkK9uN6KORI H0iHRG4SavIZXan 1C7Sab8tHSIjkDI X8YTHeED989atrc | |
SxK4zyOwyNZfQdJ 8PF4ggKvsPkonSH XC4Ht0Qz5Z. | |
END MESSAGE. |
NewerOlder