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 node | |
import * as fs from 'fs'; | |
import * as path from 'path'; | |
// https://gist.github.com/lovasoa/8691344 | |
async function* walk(dir) { | |
for await (const d of await fs.promises.opendir(dir)) { | |
const entry = path.join(dir, d.name); | |
if (d.isDirectory()) { |
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
def f(n): | |
print("hello ", n, "!") |
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 | |
###################################################################### | |
# Copyright (c) 2013, William Stein, Ondrej Certik, All rights reserved. | |
# 2-clause BSD. | |
###################################################################### | |
import json, os, random, BaseHTTPServer | |
from SimpleHTTPServer import SimpleHTTPRequestHandler |
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
https://news.ycombinator.com/reply?id=13613909&goto=item%3Fid%3D13610146%2313613909 | |
--- | |
smc=# explain SELECT * FROM file_use WHERE project_id = any(select project_id from projects where users ? '25e2cae4-05c7-4c28-ae22-1e6d3d2e8bb3') ORDER | |
BY last_edited DESC limit 100; | |
QUERY PLAN | |
--------------------------------------------------------------------------------------------------------------------------- | |
Limit (cost=0.85..8198.07 rows=100 width=242) | |
-> Nested Loop Semi Join (cost=0.85..1736663.69 rows=21186 width=242) |
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/python | |
import os, sys | |
argv = sys.argv | |
if len(argv) < 4: | |
print "*********\nThis is the replace command, by William Stein ([email protected])\n*********" | |
print "\tUsage: %s [-f] <from> <to> [file 1] [file 2] ..."%argv[0] | |
print "Optional argument -f is to not ask for confirmation."; | |
sys.exit(0) |
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
################################################################### | |
# | |
# Code to support simultaneous multiple editing | |
# sessions by different clients of a single object. This uses | |
# the Differential Synchronization algorithm of Neil Fraser, | |
# which is the same thing that Google Docs uses. | |
# | |
# * "Differential Synchronization" (by Neil Fraser). | |
# * http://neil.fraser.name/writing/sync/ | |
# * http://www.youtube.com/watch?v=S2Hp_1jqpY8 |
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
/** | |
* @author qiao / https://github.com/qiao | |
* @author mrdoob / http://mrdoob.com | |
* @author alteredq / http://alteredqualia.com/ | |
* @author WestLangley / http://github.com/WestLangley | |
* @author erich666 / http://erichaines.com | |
*/ | |
/*global THREE, console */ | |
// This set of controls performs orbiting, dollying (zooming), and panning. It maintains |
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
~$ python | |
Python 2.7.6 (default, Mar 22 2014, 22:59:56) | |
[GCC 4.8.2] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import regs_180k_200k_conca | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "regs_180k_200k_conca.py", line 5484 | |
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
httpProxy = require('http-proxy') | |
init_http_proxy_server = () => | |
_remember_me_check_for_write_access_to_project = (opts) -> | |
opts = defaults opts, | |
project_id : required | |
remember_me : required | |
cb : required # cb(err, has_access) | |
account_id = undefined |
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
# SageMath Cloud backend architecture talk at Sage Days 56 | |
## Guiding principles | |
- A place for everybody to use *all* math-related software easily, especially (but not only!) open source | |
- High availability: automatically survive failure of any proper subset of datacenters | |
- Make it very hard to permanently lose work: | |
- everything has synchronization |
NewerOlder