If you have the latest sublime text (version 4), you can just do:
subl --safe-mode
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0" /> | |
<title>base64 + lzma + iframe</title> | |
<style>iframe{position:absolute;top:0;left:0;height:100vh;width:100%;border:none}</style> | |
</head> | |
<body> | |
<iframe sandbox="allow-same-origin allow-downloads allow-scripts allow-forms allow-top-navigation allow-popups allow-modals allow-popups-to-escape-sandbox"></iframe> |
// Generative art with Markdeep diagrams. | |
// | |
// Examples: https://twitter.com/doersino/status/1321191553403129857 | |
// Markdeep: https://casual-effects.com/markdeep/features.md.html#basicformatting/diagrams | |
// | |
// Usage: | |
// 1. Navigate to: https://doersino.github.io/markdeep-diagram-drafting-board/ | |
// 2. Open the JavaScript console (if you need help, see https://webmasters.stackexchange.com/a/77337). | |
// 3. Paste the contents of this file and press Enter. | |
// 4. Type "art()" and press Enter. |
import PIL, random, sys | |
from PIL import Image, ImageDraw | |
origDimension = 1500 | |
r = lambda: random.randint(50,215) | |
rc = lambda: (r(), r(), r()) | |
listSym = [] | |
def create_square(border, draw, randColor, element, size): | |
if (element == int(size/2)): | |
draw.rectangle(border, randColor) | |
elif (len(listSym) == element+1): |
""" | |
Author: Cristian Di Pietrantonio | |
Doodle scheduler | |
""" | |
import json | |
import requests | |
import datetime | |
# Simple Google Drive backup script with automatic authentication | |
# for Google Colaboratory (Python 3) | |
# Instructions: | |
# 1. Run this cell and authenticate via the link and text box. | |
# 2. Copy the JSON output below this cell into the `mycreds_file_contents` | |
# variable. Authentication will occur automatically from now on. | |
# 3. Create a new folder in Google Drive and copy the ID of this folder | |
# from the URL bar to the `folder_id` variable. | |
# 4. Specify the directory to be backed up in `dir_to_backup`. |
function gmailAutoarchive() { | |
var delayDays = 2; // will only impact emails more than 48h old | |
var maxDate = new Date(); | |
maxDate.setDate(maxDate.getDate()-delayDays); // what was the date at that time? | |
// Get all the threads labelled 'autoarchive' | |
var label = GmailApp.getUserLabelByName("autoarchive"); | |
var threads = label.getThreads(0, 400); | |
Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.
The basic idea is that C:\Program Files\Git\mingw64\
is your /
directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git
, the mingw64
in this directory is your root. Find it by using pwd -W
).
If you go to that directory, you will find the typical linux root folder structure (bin
, etc
, lib
and so on).
If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so
import getopt | |
import re, shutil, tempfile | |
import os | |
import subprocess | |
import sys | |
# http://stackoverflow.com/questions/4427542/how-to-do-sed-like-text-replace-with-python | |
def sed_inplace(filename, pattern, repl): | |
''' |
#!/bin/bash | |
if [ $# -ne 2 ] | |
then | |
echo usage: $(basename $0) source_path dest_path | |
exit | |
fi | |
path=$2/$(dirname $1) | |
mkdir -p $path |