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
Setting, DefaultValue, INIValue, CurrentValue, Origin | |
sScreenShotBaseName:Display, <unimplemented>, <unimplemented>, <unimplemented>, INI | |
sScreenShotFolderName:Display, <unimplemented>, <unimplemented>, <unimplemented>, INI | |
sRuntimeLODDatabasePath:LODManager, <unimplemented>, <unimplemented>, <unimplemented>, INI | |
strPluginsFileHeader:General, <unimplemented>, <unimplemented>, <unimplemented>, INI | |
sLanguage:General, <unimplemented>, <unimplemented>, <unimplemented>, INI | |
sFailureMessage:LANGUAGE, <unimplemented>, <unimplemented>, <unimplemented>, INI | |
sResourcePrefixList:Archive, <unimplemented>, <unimplemented>, <unimplemented>, INI | |
sDLCDefaultVoiceSuffix:Archive, <unimplemented>, <unimplemented>, <unimplemented>, INI | |
sLocalMasterPath:General, <unimplemented>, <unimplemented>, <unimplemented>, INI |
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
Setting, DefaultValue, INIValue, CurrentValue, Origin | |
sScreenShotBaseName:Display, <unimplemented>, <unimplemented>, <unimplemented>, INI | |
sScreenShotFolderName:Display, <unimplemented>, <unimplemented>, <unimplemented>, INI | |
sRuntimeLODDatabasePath:LODManager, <unimplemented>, <unimplemented>, <unimplemented>, INI | |
strPluginsFileHeader:General, <unimplemented>, <unimplemented>, <unimplemented>, INI | |
sLanguage:General, <unimplemented>, <unimplemented>, <unimplemented>, INI | |
sFailureMessage:LANGUAGE, <unimplemented>, <unimplemented>, <unimplemented>, INI | |
sResourcePrefixList:Archive, <unimplemented>, <unimplemented>, <unimplemented>, INI | |
sDLCDefaultVoiceSuffix:Archive, <unimplemented>, <unimplemented>, <unimplemented>, INI | |
sLocalMasterPath:General, <unimplemented>, <unimplemented>, <unimplemented>, INI |
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
#!/usr/bin/env bash | |
levenshtein () | |
{ | |
local -r -- target=$1 | |
local -r -- given=$2 | |
local -r -- targetLength=${#target} | |
local -r -- givenLength=${#given} | |
local -- alt | |
local -- cost |
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
:80 { | |
root /serve | |
} |
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
#!/usr/bin/env ruby | |
require 'tmpdir' | |
require 'fileutils' | |
dir = Dir.tmpdir() | |
if File.directory?("#{dir}/bulma") | |
FileUtils.remove_dir("#{dir}/bulma") | |
end |
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
# see: https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html | |
LOGLEVELS = %w[DEBUG INFO WARN ERROR FATAL UNKNOWN].freeze | |
LOGGER = Logger.new(STDOUT) | |
level ||= LOGLEVELS.index ENV.fetch("LOG_LEVEL","WARN") # default to WARN index: 2 | |
level ||= Logger::WARN # FIX default in case of environment LOG_LEVEL value is present but not correct | |
LOGGER.level = level | |
# Usage: | |
# before launching the program: | |
# $ export LOG_LEVEL=DEBUG |
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
pragma solidity ^0.4.11; | |
/** | |
* @title Ownable | |
* @dev The Ownable contract has an owner address, and provides basic authorization control | |
* functions, this simplifies the implementation of "user permissions". | |
*/ | |
contract Ownable { | |
address public owner; |
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
def self.extract_dominant_colors(image_path, quantity=5, threshold=0.01) | |
image = MiniMagick::Image.open(image_path) | |
# Get image histogram | |
result = image.run_command('convert', image_path, '-format', '%c', '-colors', quantity, '-depth', 8, 'histogram:info:') | |
# Extract colors and frequencies from result | |
frequencies = result.scan(/([0-9]+)\:/).flatten.map { |m| m.to_f } | |
hex_values = result.scan(/(\#[0-9ABCDEF]{6,8})/).flatten | |
total_frequencies = frequencies.reduce(:+).to_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
<?php | |
/* | |
* Because the actual streaming URLs from StreamTheWorld.com stations change often, | |
* this script will dynamically redirect you to the stream URL. | |
* | |
* Do with it what you want :-) | |
* Koen (koenvh.nl) | |
* | |
* Usage: Provide a "sign" argument in your get request. | |
* This is the station's sign, which is the part after the slash without the (AAC)_SC part. |
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
require 'thread' # for Mutex: Ruby doesn't provide out of the box thread-safe arrays | |
class ThreadPool | |
def initialize(max_threads = 10) | |
@pool = SizedQueue.new(max_threads) | |
max_threads.times{ @pool << 1 } | |
@mutex = Mutex.new | |
@running_threads = [] | |
end |
NewerOlder