Skip to content

Instantly share code, notes, and snippets.

View atomize's full-sized avatar
🎹
♩♩

Berti atomize

🎹
♩♩
View GitHub Profile
@atomize
atomize / Append CSV to Sheet.py
Last active September 27, 2024 12:55 — forked from david-pettifor-nd/Append CSV to Sheet.py
Google Drive/Sheets API
# open the CSV file
csv_file = open(CSV_LOCATION, 'r')
csv_reader = csv.reader(csv_file)
values = []
for row in csv_reader:
values.append(row)
body = {
'values': values
@atomize
atomize / ccc.js
Created October 24, 2018 21:59
testGist
const unique = arr => [...new Set(arr)];
// move all text into <span>
// they occupy exactly the place necessary for the text,
for (let li of tree.querySelectorAll('li')) {
let span = document.createElement('span');
li.prepend(span);
span.append(span.nextSibling); // move the text node into span
}
// catch clicks on whole tree
@atomize
atomize / index.html
Last active October 19, 2018 20:57
one time listener
<!DOCTYPE html>
<html lang="en">
<head>
<title>Animate.css</title>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1, minimal-ui" />
<link rel="dns-prefetch" href="//fonts.googleapis.com" />
<link rel="dns-prefetch" href="//code.jquery.com" />
package main
import (
"bufio"
"flag"
"fmt"
"io"
"os"
"path/filepath"
"regexp"
@atomize
atomize / rsync.sh
Created October 18, 2018 22:28
Rsync with modern options for skipping compression.
export RSYNC_SKIP_COMPRESS=3fr/3g2/3gp/3gpp/7z/aac/ace/amr/apk/appx/appxbundle/arc/arj/arw/asf/avi/bz2/cab/cr2/crypt[5678]/dat/dcr/deb/dmg/drc/ear/erf/flac/flv/gif/gpg/gz/iiq/iso/jar/jp2/jpeg/jpg/k25/kdc/lz/lzma/lzo/m4[apv]/mef/mkv/mos/mov/mp[34]/mpeg/mp[gv]/msi/nef/oga/ogg/ogv/opus/orf/pef/png/qt/rar/rpm/rw2/rzip/s7z/sfx/sr2/srf/svgz/t[gb]z/tlz/txz/vob/wim/wma/wmv/xz/zip
rsync --skip-compress=$RSYNC_SKIP_COMPRESS .....
rsync -av --progress -e "ssh -T -c aes128-ctr -o Compression=no -x" source/ [email protected]:/destination
The key is leaving off the compression (-z) and using aes128-ctr on Ubuntu 18 (latest cipher support)
@atomize
atomize / onchange.sh
Created October 18, 2018 22:25 — forked from senko/onchange.sh
Watch current directory and execute a command if anything in it changes
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <[email protected]>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of
@atomize
atomize / s3.sh
Created October 18, 2018 19:58 — forked from chrismdp/s3.sh
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@atomize
atomize / range.js
Created October 9, 2018 18:30
Generate range using Array.from() - with alphabet example.
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Examples#Sequence_generator_(range)
const range = (start, stop, step) => Array.from({ length: (stop - start) / step }, (_, i) => start + (i * step));
// Generate numbers range 0..4
range(0, 5, 1);
// [0, 1, 2, 3, 4]
// Generate the alphabet using Array.from making use of it being ordered as a sequence
@atomize
atomize / cccagg_temp.js
Last active October 16, 2018 17:39
cccagg temp
let grouper;
const appInfo = {
aggSubs: [],
allSubs: [],
actualSubs: new Set(),
globalmenu: {},
imageUrls: new Map(),
pair: ["???", "???"]
};