This file contains hidden or 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
# 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 |
This file contains hidden or 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 unique = arr => [...new Set(arr)]; |
This file contains hidden or 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
// 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 |
This file contains hidden or 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
<!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" /> |
This file contains hidden or 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
package main | |
import ( | |
"bufio" | |
"flag" | |
"fmt" | |
"io" | |
"os" | |
"path/filepath" | |
"regexp" |
This file contains hidden or 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
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) |
This file contains hidden or 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 | |
# | |
# 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 |
This file contains hidden or 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
# 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 |
This file contains hidden or 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://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 |
This file contains hidden or 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
let grouper; | |
const appInfo = { | |
aggSubs: [], | |
allSubs: [], | |
actualSubs: new Set(), | |
globalmenu: {}, | |
imageUrls: new Map(), | |
pair: ["???", "???"] | |
}; |