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
| import math | |
| import numpy as np | |
| from PIL import Image | |
| from sklearn.cluster import KMeans | |
| qC = 4.9226 | |
| qD = 1.4060 | |
| qR = 0.7932 | |
| def calculate_dark_colorfulness(rgb): |
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
| import json | |
| from flask import Flask, send_from_directory | |
| from flask_restful import Resource, Api | |
| app = Flask(__name__) | |
| api = Api(app) | |
| class CurrentSong(Resource): | |
| def get(self): | |
| with open('data.json') as f: |
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 | |
| cat > "/etc/systemd/system/${1}.service" << EOF | |
| [Unit] | |
| Description=$2 | |
| After=network-online.target | |
| [Service] | |
| Type=simple | |
| User=%i |
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
| $(document).keydown(function(event){ | |
| var player = $('video')[0] | |
| if (event.keyCode == 39 || event.keyCode == 68){ | |
| player.currentTime = player.currentTime + 10 | |
| } else if (event.keyCode == 37 || event.keyCode == 65){ | |
| player.currentTime = player.currentTime - 10 | |
| } else if (event.keyCode == 32){ | |
| event.preventDefault(); | |
| if (player.paused){ | |
| player.play() |
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
| var checkPixels = function(){ | |
| var pixelData = document.getElementsByClassName('runner-canvas')[0].getContext('2d').getImageData(220, 230, 1, 1).data; | |
| if (pixelData.some(function(e) {return e>0})){ | |
| Runner.instance_.tRex.startJump() | |
| } | |
| } | |
| var interval = setInterval(checkPixels, 10) |
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 | |
| RED='\033[0;31m' | |
| PROJECT_NAME=$1 | |
| PROJECTS_REPOSITORY_FILE_FULL_PATH="/path/to/saveproj/output/file" | |
| PROJECTS_FOLDER_FULL_PATH="/path/to/your/projects/folder" | |
| if ! line=$(grep "\<$PROJECT_NAME\>" $PROJECTS_REPOSITORY_FILE_FULL_PATH) | |
| then | |
| echo -e "${RED}$PROJECT_NAME not found in projects list. You can create one by using the saveproj tool." | |
| else | |
| directory_name=${line##* } |