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
#Copyright 2022 Google LLC. | |
#SPDX-License-Identifier: Apache-2.0 | |
import os | |
import psutil | |
from google.cloud.storage import Client | |
def get_mem_mb(): | |
return psutil.Process().memory_info().rss / (1024 * 1024) |
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
#Copyright 2022 Google LLC. | |
#SPDX-License-Identifier: Apache-2.0 | |
bq --location="EU" load \ | |
--replace \ | |
--source_format="NEWLINE_DELIMITED_JSON" \ | |
--autodetect \ | |
your_dataset.your_table \ | |
./logs.jsonl |
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 re | |
import random | |
# Load the file into a graph represented by a dict of lists | |
def load_graph(): | |
g = {} | |
f = open('kargerMinCut.txt') | |
lines = f.readlines() | |
f.close() |
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
from email.mime.text import MIMEText | |
from email.mime.multipart import MIMEMultipart | |
from subprocess import Popen, PIPE | |
html = MIMEText("<html><head><title>Test Email</title></head><body>Some HTML</body>", "html") | |
msg = MIMEMultipart("alternative") | |
msg["From"] = "you@yourmail.com" | |
msg["To"] = "recipient@mail.com" | |
msg["Subject"] = "Python sendmail test" |
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
version: '3.3' | |
services: | |
db: | |
image: mysql:5.7 | |
volumes: | |
- db_data:/var/lib/mysql | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: somewordpress |
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
from itertools import chain | |
intersection = [] | |
sets = [[0,4,5,2,1],[1,3,6,2,4],[4,1,2,5,7,0]] | |
merged = list(chain.from_iterable(sets)) | |
merged.sort() |
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
function urlObject(options) { | |
"use strict"; | |
/*global window, document*/ | |
var url_search_arr, | |
option_key, | |
i, | |
urlObj, | |
get_param, | |
key, |
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
{ | |
"title":"Tool Title", | |
"description": "Tool Description", | |
"version": "", | |
"author": { | |
"name":"", | |
"email":"", | |
"website":"" | |
}, | |
"repository_url": "", |
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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating | |
// shim later with setTimeout fallback | |
window.requestAnimFrame = (function(){ | |
return window.requestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.mozRequestAnimationFrame || | |
window.oRequestAnimationFrame || | |
window.msRequestAnimationFrame || | |
function( callback ){ | |
window.setTimeout(callback, 1000 / 60); |
NewerOlder