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
#!/bin/bash -e | |
# Reuploads files to Google Cloud Storage and adds gzip compression and 60 | |
# second cache headers. | |
# | |
# Usage: | |
# ./urls.sh https://sites.research.google/relate/ > urls.txt | |
# ./reupload.sh urls.txt | |
function get_gs_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
import {terser} from 'rollup-plugin-terser'; | |
import {UserConfig} from 'vite'; | |
import fs from 'fs'; | |
import litStylesLoader from '../configs/lit-styles.js'; | |
export interface VitePresetOptions { | |
scssIncludePaths: string[]; | |
} | |
function toScssPath(path) { |
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
var el = document.createElement('script'); | |
el.src = 'https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js'; | |
document.body.appendChild(el); | |
var el2 = document.createElement('script'); | |
el2.src = 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js'; | |
document.body.appendChild(el2); | |
el2.addEventListener('load', function() { | |
$('html, body').animate({ | |
scrollTop: 3495 | |
}, 2000, 'easeOutCubic'); |
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
sudo spctl --master-disable |
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
[alias] | |
# List your commits by quarters of a year in reverse order (short version) | |
q1 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"January $year\" --until \"March $year\" --oneline --reverse $@; }; f" | |
q2 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"April $year\" --until \"June $year\" --oneline --reverse $@; }; f" | |
q3 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"July $year\" --until \"September $year\" --oneline --reverse $@; }; f" | |
q4 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"October $year\" --until \"December $year\" --oneline --reverse $@; }; f" | |
# List your commits by quarters of a year in reverse order (long version) | |
quarter1 = "!f() { year=$1; shift; git log --author \"$(git config --get user.name)\" --since \"January $year\" --until \"March $year\" --reverse $@; }; f" | |
quarter2 = "!f() { year=$1; shift; git |
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
When using the Google App Engine Users API, there is no way to enforce the account chooser for users signed in to multiple accounts. You can do so by using `users.create_login_url` and replacing the output of the function as so: | |
``` | |
from google.appengine.api import users | |
url = users.create_login_url() | |
url = url.replace('/accounts/ServiceLogin', '/a/SelectSession', 1) | |
``` | |
This is not guaranteed to work if the output of `users.create_login_url` changes. |
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
``` | |
gcloud service-management enable drive | |
gcloud service-management enable storage-api.googleapis.com | |
gcloud service-management enable language.googleapis.com | |
gcloud iam service-accounts list | |
gcloud iam service-accounts create <name> | |
gcloud iam service-accounts keys create --iam-account <name>@$(project).iam.gserviceaccount.com <filename> | |
``` | |
``` |
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
jpegoptim -f --strip-all file.jpg | |
optipng -force -o7 file.png \ | |
&& advent -z4 file.png \ | |
&& pngcrush \ | |
-rem gAMA \ | |
-rem alla \ | |
-rem cHRM \ | |
-rem iCCP \ | |
-rem sRGB \ |
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
convert \ | |
-fill "#485A64" \ | |
-font 'HelveticaNeue.dfont' \ | |
-gravity south \ | |
-weight 400 \ | |
-draw "translate 7,53 text 0,0 'FEGRB'" \ | |
-pointsize 65 \ | |
base.png \ | |
out/out.png | |
open out/out.png |
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
bucket ?= bucket | |
update_cors: | |
gsutil cors set gcs-cors.json gs://$(bucket) |
NewerOlder