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 links | |
console.log([].slice.call(document.getElementsByTagName('a')).map(z => z['href']).filter(z => z.match(/^https:\/\/github.com\/ORGANIZATION\/[0-9A-Za-z\-\_\.]+$/)).join('\n')) | |
// ssh links | |
console.log([].slice.call(document.getElementsByTagName('a')).map(z => z['href']).filter(z => z.match(/^https:\/\/github.com\/ORGANIZATION\/[0-9A-Za-z\-\_\.]+$/)).map(z => '[email protected]:'+z.substring(19)+'.git').join('\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
import numpy | |
import tqdm | |
dataset_file = 'GoogleNews-vectors-negative300.bin' | |
output_file = 'dataset-trimmed.bin' | |
def read_dataset_header(f) -> tuple[int, int]: | |
line = bytearray() |
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
CREATE SEQUENCE IF NOT EXISTS public.snowflake_id_seq | |
MINVALUE 0 MAXVALUE 1023 | |
CYCLE; | |
ALTER SEQUENCE public.global_id_seq OWNER TO postgres; | |
-- 41 bits for time in milliseconds | |
-- (41 years of IDs from epoch) | |
-- 13 bits for the logical shard ID | |
-- 10 bits for the global auto-incrementing sequence (modulus 1024). | |
-- This means we can generate 1024 IDs, per shard, per millisecond |
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
;; nano.el -- A very minimal emacs | |
;; Usage: emacs -q -l nano.el | |
;; | |
;; Copyright (C) 2020 Nicolas .P Rougier | |
;; | |
;; Author: Nicolas P. Rougier <[email protected]> | |
;; | |
;; This program is free software; you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation, either version 3 of the License, or |
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
const blessed = require("blessed"); | |
window.onload = function () { | |
const term = new Terminal({ | |
cols: 80, | |
rows: 24 | |
}); | |
term.open(document.body); | |
term.write('\x1b[31mWelcome to term.js!\x1b[m\r\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
""" | |
A wrapper for Intranet2's single sign-on system. | |
Here's a brief overview of how Iodine SSO works: | |
- you make a request token (with generate_token) | |
- you redirect the user to a URL containing that request token | |
- when the user allows access, they are redirected back to your application | |
with an access token in the "sso" parameter | |
- you verify the access token (with check_access_token_validity) | |
- if you need to, you can start a session to access the API and such |