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 win32clipboard # pip install pywin32 if needed | |
import sys, os, subprocess | |
fname = sys.argv[1] | |
win32clipboard.OpenClipboard() | |
filenames = win32clipboard.GetClipboardData(win32clipboard.CF_HDROP) | |
win32clipboard.CloseClipboard() | |
for filename in filenames: | |
base = os.path.basename(filename) | |
link = os.path.join(fname, base) | |
subprocess.Popen('mklink %s "%s" "%s"' % ('/d' if os.path.isdir(filename) else '', link, filename), shell=True) |
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 sqlite3 | |
db = sqlite3.connect(':memory:') | |
c = db.cursor() | |
c.execute('CREATE TABLE mytable (description text)') | |
c.execute('INSERT INTO mytable VALUES ("Riemann")') | |
c.execute('INSERT INTO mytable VALUES ("All the Carmichael numbers")') | |
print '1) EQUALITY' | |
c.execute('SELECT * FROM mytable WHERE description == "Riemann"'); print 'Riemann:', c.fetchall() |
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 os, glob, pdfrw # todo: pip install pdfrw | |
for f in glob.glob('*.pdf'): | |
if '_cut.pdf' in f: | |
continue | |
writer = pdfrw.PdfWriter() | |
for page in pdfrw.PdfReader(f).pages: | |
for y in [0, 0.5]: | |
newpage = pdfrw.PageMerge() | |
newpage.add(page, viewrect=(0, y, 1, 0.5)) | |
p = newpage.render() |
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> | |
<style> | |
* { margin: 0; } | |
#topright { float: right; width: 100px; background-color: blue; -webkit-app-region: no-drag; } | |
#topright:hover { background-color: black; } | |
#topleft { background-color: red; -webkit-app-region: drag; padding: 10px; } | |
</style> | |
</head> | |
<body> |
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
""" | |
Quick benchmark of DuckDB / Sqlite3 (disclaimer: it doesn't necessarily showcase the power of both solutions, there might be better ways I'm not aware of) | |
https://gist.github.com/josephernest/2c02f7627b83a32fd2086fe9dde15215.js | |
https://github.com/cwida/duckdb/issues/1249 | |
1M rows 10M rows 20M rows 50M rows | |
duckdb 13ms ? 130ms ? 285ms ? ? | |
sqlite 13ms 26 MB 113ms 260 MB 221ms 527 MB ? | |
""" |
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
{"state": "checked"} |
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
Hello, now click on the "Back" history button of your browser. |
OlderNewer