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/sh | |
# Install OpenTTD on my RaspberryPi running Buster | |
## Download and extract | |
wget https://proxy.binaries.openttd.org/openttd-releases/1.9.2/openttd-1.9.2-source.tar.xz | |
tar -xf openttd-1.9.2-source.tar.xz | |
cd openttd-1.9.2 | |
## Install without UI, because it's just a server |
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/sh | |
# Usage: bash list-ports.sh PRIVATE_PORT | |
# PRIVATE_PORT default 80 | |
privatePort=${1-80} | |
services=`docker-compose ps --service --filter "status=running" 2> /dev/null` | |
if [ -z "$services" ] | |
then |
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
FROM r-base | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends \ | |
libxml2-dev \ | |
libnetcdf-dev |
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
vim `ls /home/*/public_html/.htaccess` |
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
sed -i-backup "s/RewriteCond \%{HTTP_HOST}.*//" .htaccess |
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 | |
// functions.php | |
add_filter('acf/location/rule_types', 'acf_location_rules_types'); | |
function acf_location_rules_types( $choices ) { | |
$choices['Post']['post-type-has-taxonomy'] = __('Post Type has Taxonomy'); | |
return $choices; | |
} | |
add_filter( 'acf/location/rule_values/post-type-has-taxonomy', 'acf_location_rules_values_has_taxonomy' ); | |
function acf_location_rules_values_has_taxonomy( $choices ) { |
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
# This example requires CSVkit (https://github.com/wireservice/csvkit). A Python toolset with a lot of very cool CSV tools. | |
# IMPORTANT NOTE: make sure to use a proper csv file. I had a lot of trouble with a csv file created by a service with Dutch | |
# as locale. Changing it to US solved the problem. Some locales use comma's to seperate point numbers. A semicolon is then | |
# used. | |
# Create table example and Load file-a.csv into it | |
csvsql --db sqlite:///example.db --table example --insert file-a.csv | |
# Add an extra file to table example |
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
brew install gdal --with-python | |
brew install homebrew/python/numpy | |
gdal2xyz.py file-name.adf output.txt | |
# Windows: | |
cd folder/containing/gdal2zys | |
python gdal2xyz.py file-name.adf output.txt |
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
trim(preg_replace("/^(<br \/>)/", "", $output, 1)); |
NewerOlder