View batch-rename-files.py
import os
os.chdir('your-path-here')
print(os.listdir('.'))
for filename in os.listdir('.'):
os.rename(filename, filename.replace('src', 'opt'))
View playground.rs
fn main() {
println!("Hello, world!");
let d = 0.012;
let c = d + d + d;
println!("{}", c);
}
View bisac.csv
ANT000000 Antiques & Collectibles / General
ANT001000 Antiques & Collectibles / Americana
ANT002000 Antiques & Collectibles / Art
ANT003000 Antiques & Collectibles / Autographs
ANT005000 Antiques & Collectibles / Books
ANT006000 Antiques & Collectibles / Bottles
ANT007000 Antiques & Collectibles / Buttons & Pins
ANT008000 Antiques & Collectibles / Care & Restoration
ANT009000 Antiques & Collectibles / Transportation
ANT010000 Antiques & Collectibles / Clocks & Watches
View tmux.conf
set-option -g allow-rename off
set-option -g history-limit 10000
set-option -g mouse on
View git-mass-push.sh
# Change REMOTE to be whatever remote you need
REMOTE="backup-local"
# Acknowledge action with user
read -p $"\e[33mPush all git repos in this directory to their '$REMOTE' remotes?\e[0m [T/n] " answer
echo
case $answer in
[Nn]* ) echo -e "\e[31mMass push cancelled.\e[0m"; break;;
* ) echo "Pushing all git repos to '$REMOTE'";
View marcadorjs.html
<!DOCTYPE html>
<html>
<head>
<title>Bookmarklet</title>
</head>
<body>
<h1>First Class</h1>
<iframe src=""></iframe>
<a href="javascript:(function () { const iframe = document.createElement('iframe'); iframe.style.cssText = 'position:absolute;top:0;left:0;width: 100vw;height:80vh;z-index:99999;overflow: hidden;background:#151414'; iframe.src = 'https://player.vimeo.com/video/197230029?api=1&player_id=player1&autoplay=true'; iframe.setAttribute('frameBorder', '0'); iframe.setAttribute('scrolling', 'no'); document.body.innerHTML= ''; document.body.setAttribute('style', 'display:block !important;background: #151414'); document.body.appendChild(iframe); })();">Hello!~!</a>
</body>
View playground.rs
fn factorize(mut composite: u64) -> Vec<u64> {
let mut factors: Vec<u64> = Vec::new();
while composite % 2 == 0 {
composite /= 2;
factors.push(2);
}
let mut f = 3;
while f * f <= composite {
if composite % f == 0 {
factors.push(f);
View read-json.py
import json
import pprint
with open('data.json') as data_file:
data = json.load(data_file)
pprint.pprint(data)
View playground.rs
let mut db = DBSCAN::new(1.5, 5);
db.train(&jaccard_matrix).unwrap();
let cluster_assignments = db.clusters().unwrap();
let mut clusters = Vec::<Vec::<usize>>::new();
for (i,assignment) in cluster_assignments.iter().enumerate() {
if assignment.is_some(){
let val = assignment.unwrap();
println!("read {}: cluster {}", read_ids[i], val );
if clusters.len() < val{
clusters.push(vec![i])