curiouser / gist:7a583fd94b2a4af5bfb6a2f9e1cf797a
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1 day ago
| 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 / gist:e8a1a08ee0104fdb8fb16ba7db3ff3a0
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1 day ago
| 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 / gist:c7393693654848eb834af46b09f55f04
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1 day ago
| 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 / gist:5521d5a3a20b417c81609b21b9e84b6b
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1 day ago
| 1 | // Navigate to your "My List" page before running this in your web console |
| 2 | |
| 3 | // Get a list of all titles |
| 4 | var movies = document.querySelectorAll(".slider-item"); |
| 5 | |
| 6 | // pick a random number between 0 and length |
| 7 | var random = Math.floor(Math.random() * movies.length); |
| 8 | |
| 9 | // this is our movie |
| 10 | var movie = movies[random]; |
curiouser / gist:83dbd7681c7b44e1aa664720d879fd40
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1 day ago
| 1 | // This script is intended to be run from a web console. It must be run from the correct webpage. |
| 2 | // Step 1: Fill out this and search https://process.dmv.ny.gov/FacilityLookup/ |
| 3 | // Step 2: Select your vehicle type, etc until you receive results |
| 4 | // Step 3: Edit the countResults variable below to the actual number |
| 5 | // Step 4: Inject jQuery into the webpage by copying the commented code below into the web console |
| 6 | // var jq = document.createElement('script');jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";document.getElementsByTagName('head')[0].appendChild(jq); |
| 7 | |
| 8 | // Step 5: Copy and paste the below into your web console and run it. When the searching is finished, you should receive an array of matches logged to console. |
| 9 | |
| 10 | // modify this value to be the total # of results |
curiouser / gist:6c053caa98944d0aa3de4d966017d380
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1 day ago
| 1 | const glob = require("glob"); |
| 2 | const { execSync } = require('child_process'); |
| 3 | |
| 4 | console.log('building list of files'); |
| 5 | |
| 6 | const opts = { absolute: true }; |
| 7 | var files = glob.sync("**/*.ts", opts).concat(glob.sync("**/*.tsx", opts)).filter(f => f.indexOf('node_modules') < 0); |
| 8 | |
| 9 | console.log(`found ${files.length} files`); |
curiouser / gist:aa1d757feb2d42b1abd055f846527dd1
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1 day ago
| 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 |
curiouser / gist:b537251db56640ac9b4f92dff80fb9a5
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1 day ago
| 1 | $ rm -Rf ~/.config/darktable ~/.cache/darktable |
| 2 | $ /Applications/darktable.app/Contents/MacOS/darktable -d all |
| 3 | 0.000898 application_directory: /Applications/darktable.app/Contents/MacOS |
| 4 | 0.001040 darktable.datadir: /Applications/darktable.app/Contents/Resources/share/darktable |
| 5 | 0.001123 darktable.plugindir: /Applications/darktable.app/Contents/Resources/lib/darktable |
| 6 | 0.001196 darktable.localedir: /Applications/darktable.app/Contents/Resources/share/locale |
| 7 | 0.001392 darktable.configdir: /Users/curiouser/.config/darktable |
| 8 | 0.001539 darktable.cachedir: /Users/curiouser/.cache/darktable |
| 9 | 0.001617 darktable.sharedir: /Applications/darktable.app/Contents/Resources/share |
| 10 | 0.001709 darktable.tmpdir: /private/var/folders/jg/8sl7jff55y7dh77tfpztd4pr0000gn/T |
curiouser / gist:af58296bce944d2eae9d11a1cf2af21a
0 вподобань
0 форк(-ів)
2 файл(-ів)
Остання активність 1 day ago
| 1 | #!/bin/bash |
| 2 | |
| 3 | echo 'restoring text-scaling to 133%' |
| 4 | gsettings set org.gnome.desktop.interface text-scaling-factor 1.33 |
| 5 | |
| 6 | echo 'restoring auto suspend on AC power' |
| 7 | gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'suspend' |
| 8 | |
| 9 | echo 're-enabling suspend-then-hibernate' |
| 10 | test -h /etc/systemd/system/systemd-suspend.service || sudo ln -s /usr/lib/systemd/system/systemd-suspend-then-hibernate.service /etc/systemd/system/systemd-suspend.service |
curiouser / gist:36b58f3bef744e5483fd74183a02a103
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1 day ago
| 1 | #!/bin/bash |
| 2 | ### FROM BOOT DISK |
| 3 | # remove cryptswap entry |
| 4 | vi /etc/crypttab |
| 5 | |
| 6 | # remove swap from fstab |
| 7 | vi /etc/fstab |
| 8 | |
| 9 | # reboot into firmware, select one time boot and choose USB live installer |
| 10 | systemctl reboot --firmware |
Новіше
Пізніше