This file contains 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
(() => { | |
// A script I created to automatically play the tavern story in bitefight game. | |
// Copy the script into any chrome extension, and enable it in tavern page of bitefight game. | |
// Refresh, and let it level you up. | |
const desiredOptionsOrder = [ | |
'Continue (3 AP)', | |
'Complete story', | |
'Continue', |
This file contains 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
#!/usr/bin/env python3 | |
"""A python script to perform audio watermark embedding/detection | |
on the basis of direct-sequence spread spectrum method.""" | |
# Copyright (C) 2020 by Akira TAMAMORI | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or |
This file contains 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
diff --git a/src/helpers/similarityCheck.js b/src/helpers/similarityCheck.js | |
index 1e4063a..7430e3a 100644 | |
--- a/src/helpers/similarityCheck.js | |
+++ b/src/helpers/similarityCheck.js | |
@@ -53,12 +53,12 @@ const similarityCheck = async (points, spell) => { | |
ctx.lineWidth = LINE_SIZE-4; | |
ctx.strokeStyle='#0c3240'; | |
ctx.stroke(); | |
- const buff = canvas.toBuffer('image/png', { compressionLevel: 3, filters: canvas.PNG_FILTER_NONE }) | |
+ const buffer = canvas.toBuffer('image/png', { compressionLevel: 3, filters: canvas.PNG_FILTER_NONE }) |
This file contains 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 | |
# This script builds an ffmpeg4 allowing us to install PyAV with pip3 install av | |
# I tried to make it use cuda, but failed, so far only libx264 works well (a fast cpu encoder). | |
# I'm using jetson agx 32 with jetpack 4.6 on ubuntu 18 | |
# makesure jetpack packages are install (cuda part is removed from original script) | |
# it doesn't use nvmpi hardware encoder but rather tries to use gpu/cuda accelaration | |
# I couldn't make nvmpi version (ffmpeg-jetson repo) work successfully. |
This file contains 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
/* | |
copy this to "Run Javascript" extension on a limesurvey survey page | |
when you click enable on "xxx" it will start working, disable by clicking the checkbox again. | |
*/ | |
setTimeout(() => { | |
const a = "aeiou"; | |
const b = "bcdfghjklmnpqrstvwxyz"; | |
const ranf = (i, j, p=1) => Math.pow(Math.random(), p) * (j - i) + i; | |
const ran = (i, j, p=1) => Math.floor(ranf(i,j,p)); | |
const ranG = (ls) => ls.map(l => l[ran(0,l.length)]).join(''); |
This file contains 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
#!/usr/bin/env bash | |
# Renames subtitles files according to tv shows names found in a directory and its subdirectories RECURSIVELY | |
# Acceped syntaxes for season/episode are: 304, s3e04, s03e04, 3x04, Season 03 Episode 04 (case insensitive) | |
# | |
# Usage: | |
# Put this gist somewhere in your $PATH, like /usr/local/bin/subtitles-renamer | |
# Chmod +x it | |
# cd ~/YourHolidaysTvShowsWithSubtitles | |
# subtitles-renamer |
This file contains 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
#!/usr/bin/env bash | |
wget -O - http://debian.neo4j.org/neotechnology.gpg.key | apt-key add - | |
echo 'deb http://debian.neo4j.org/repo stable/' > /etc/apt/sources.list.d/neo4j.list | |
apt-get update | |
apt-get -y install neo4j=1:3.5.14 | |
cd /var/lib/neo4j/plugins || exit | |
wget https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/3.5.0.11/apoc-3.5.0.11-all.jar | |
wget https://github.com/neo4j-contrib/neo4j-graph-algorithms/releases/download/3.5.4.0/graph-algorithms-algo-3.5.4.0.jar | |
wget https://github.com/neo4j-contrib/spatial/releases/download/0.26.2-neo4j-3.5.2/neo4j-spatial-0.26.2-neo4j-3.5.2-server-plugin.jar | |
echo 'dbms.security.procedures.unrestricted=apoc.*, algo.*' >> /etc/neo4j/neo4j.conf |
This file contains 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
#!/usr/bin/env bash | |
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add - | |
echo 'deb https://debian.neo4j.com stable 4.0' | sudo tee /etc/apt/sources.list.d/neo4j.list | |
apt-get update | |
apt-get -y install neo4j | |
cd /var/lib/neo4j/plugins || exit | |
wget https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/4.0.0.2/apoc-4.0.0.2-all.jar | |
echo 'dbms.security.procedures.unrestricted=apoc.*' >> /etc/neo4j/neo4j.conf | |
echo 'dbms.default_listen_address=0.0.0.0' >> /etc/neo4j/neo4j.conf | |
service neo4j restart |
This file contains 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
// download run javascript extension https://chrome.google.com/webstore/detail/run-javascript/lmilalhkkdhfieeienjbiicclobibjao?hl=en | |
// go to a page inside timenotes.io | |
// open run javascript extension and check "Enable on timenotes.io" | |
// copy this code inside the extension popup | |
// click save & run | |
// now, whenever you go to a project's task page and reload page, you'll get start tracking button | |
// note that I'm not affiliated with timenotes, just a fan of their work/happy user. | |
(() => { | |
const path = window.location.pathname; | |
if (path.match(/^\/projects\/[a-f0-9\-]+\/tasks_overview\/?$/)) { |
This file contains 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
// go to https://aws.amazon.com/ec2/pricing/on-demand/ and run this in console | |
(() => { | |
let table = document.querySelector('div.js-active').children[0]; | |
let bodies = table.getElementsByTagName('tbody'); | |
bodies = Array.from(bodies); | |
bodies = bodies.map((b) => Array.from(b.children)); | |
let rows = bodies.reduce((acc, x) => [...acc, ...Array.from(x.slice(1)).map((r) => [x[0].children[0].innerText, ...Array.from(r.children).map((c) => c.innerText)])], []); | |
let data = rows.map(([type, name, vcpu, ecu, memory, storage, price]) => ({ name, vcpu, ecu, memory, storage, price, type })); | |
data.sort(({ price: priceA }, { price: priceB }) => parseFloat(priceB.substr(1)) - parseFloat(priceA.substr(1))); | |
data.forEach(({name, vcpu, ecu, memory, storage, price, type }) => console.log(`price: ${price} name: ${name} - vcpus: ${vcpu} - ecu: ${ecu} - memory: ${memory} - storage: ${storage} - type: ${type}`)); |