curiouser / cakeThief.js

0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 2 months ago
A solution to this code challenge: https://www.interviewcake.com/question/javascript/cake-thief
1 class Bag {
2 constructor (capacity) {
3 this.capacity = capacity;
4 this.cakes = [];
5 this.weight = 0;
6 this.value = 0;
7 }
8
9 addCake (cake) {
10 this.cakes.push(cake);

curiouser / itunes.py

0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 2 months ago
Script to load an iTunes Media Library.xml, find duplicate tracks, remove the track with a larger file size and ensure that the remaining track inherits the older track_id
1 import json
2 import os
3 import re
4 from xml.etree import ElementTree
5
6 def get_track_attr (track, attr_name):
7 # iterate over each attr to find the filename
8 attributes = list(track)
9 for a in range(len(attributes)):
10 attr = attributes[a]

curiouser / color-graduation.js

0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 2 months ago
An update to the first solution here: https://gist.github.com/jayzawrotny/3079b17004a5237910a58f877bac1d58f
1 // Vanilla solution
2 let format = require('util').format;
3
4 const COLORS = [
5 { stop: 0, rgb: [35, 198, 161] },
6 { stop: 6, rgb: [245, 235, 73] },
7 { stop: 48, rgb: [245, 51, 0] },
8 ];
9
10 function getRGBColor (hours) {

curiouser / arm64-bionic-zfs

0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 2 months ago
Configuration for a fresh Ubuntu 18.04 Rock64 install. Adds a user, sets timezone, installs zfs, samba, configures disk power management, etc
1 #!/bin/bash
2
3 #
4 # Read this script and modify it before running. It's not tested as is and is not
5 # meant to be run unsupervised.
6 #
7
8 hostname='YOUR_DESIRED_HOSTNAME'
9 user='YOUR_USERNAME'
10 hdd_spindown_timeout=1800
Новіше Пізніше