Skip to content

Instantly share code, notes, and snippets.

View kastnerp's full-sized avatar
:octocat:
Focusing

Patrick Kastner kastnerp

:octocat:
Focusing
View GitHub Profile
@maximlt
maximlt / run_python_script_in_conda_env.bat
Last active October 21, 2025 12:57
Run a Python script in a conda environment from a batch file
@echo OFF
rem How to run a Python script in a given conda environment from a batch file.
rem It doesn't require:
rem - conda to be in the PATH
rem - cmd.exe to be initialized with conda init
rem Define here the path to your conda installation
set CONDAPATH=C:\ProgramData\Miniconda3
rem Define here the name of the environment
module.exports = ({ env }) => {
if(env('NODE_ENV') === 'development'){
return {
defaultConnection: 'default',
connections: {
default: {
connector: 'bookshelf',
settings: {
client: 'sqlite',
filename: env('DATABASE_FILENAME', '.tmp/data.db'),
@anttilipp
anttilipp / Tdata.csv
Created May 19, 2020 18:13
Code and data to reproduce the temperature anomaly animation.
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 143 columns, instead of 43 in line 1.
Country,ISOA3,Continent,1880,1881,1882,1883,1884,1885,1886,1887,1888,1889,1890,1891,1892,1893,1894,1895,1896,1897,1898,1899,1900,1901,1902,1903,1904,1905,1906,1907,1908,1909,1910,1911,1912,1913,1914,1915,1916,1917,1918,1919,1920,1921,1922,1923,1924,1925,1926,1927,1928,1929,1930,1931,1932,1933,1934,1935,1936,1937,1938,1939,1940,1941,1942,1943,1944,1945,1946,1947,1948,1949,1950,1951,1952,1953,1954,1955,1956,1957,1958,1959,1960,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019
"Afghanistan","AFG","Asia",-0.325,-0.160,-0.814,-0.773,-0.971,-1.133,-1.123,-0.478,0.088,-0.679,-0.617,-1.107,-0.323,-0.914,-1.006,-0.286,-0.299,-0.759,-0.959,0.192,-0.560,-0.291,0.206,-1.049,-0.403,-0.859,-0.386,-0.973,-0.615,-0.069,-0.620,-0.842,-0.251,-0.432,0.256,0.886,-0.614,-0.067,-0.513,-0.38
@vvaezian
vvaezian / Country Names with Abbreviations.csv
Last active November 18, 2022 12:57
Country names together with their ISO 3166-1 alpha-2 codes
Andorra AD
United Arab Emirates AE
Afghanistan AF
Antigua and Barbuda AG
Anguilla AI
Albania AL
Armenia AM
Angola AO
Antarctica AQ
Argentina AR
@xirixiz
xirixiz / pihole-macvlan-synology-docker.txt
Last active September 6, 2025 08:26
Add a PiHole instance on a macvlan enabled Docker network (Synology eth0 example)
#!/bin/bash
# NAS IP: 192.168.1.10 in this example
# DHCP scope reservation for macvlan: 192.168.1.210/28 (Details below)
## Network: 192.168.1.210/28
## HostMin: 192.168.1.211
## HostMax: 192.168.1.224
## Hosts/Net: 14
# Create a Synology macvlan0 bridge network attached to the physical eth0, and add the ip range scope (sudo)
const $ = $jQueryWom;
let boxes = $('.wom_hidecheckbox2');
let form = $('.wom_hidecheckbox2').parents('form');
let ids = [];
boxes.each(function () {ids.push(this.name)});
boxes.prop('checked', false);
@vdbelt
vdbelt / cloudflare-purge-cache-service-worker.js
Created August 21, 2018 11:43
A CloudFlare service worker that proxies purge cache requests. Example: https://example.com/__purge_cache?zone=XX
addEventListener('fetch', event => {
event.respondWith(purgeCache(event.request))
})
async function purgeCache(request) {
const url = new URL(request.url)
@maptiler
maptiler / globalmaptiles.py
Created August 13, 2018 10:37
globalmaptiles.py
#!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL2Tiles, Google Summer of Code 2007 & 2008
# Global Map Tiles Classes
# Purpose: Convert a raster into TMS tiles, create KML SuperOverlay EPSG:4326,
# generate a simple HTML viewers based on Google Maps and OpenLayers
# Author: Klokan Petr Pridal, klokan at klokan dot cz
# Web: http://www.klokan.cz/projects/gdal2tiles/
@tpraxl
tpraxl / .qmail-test
Created June 7, 2018 11:32
Autorespond using IMAP on Uberspace 7 (U7)
|maildrop $HOME/.test-filter
@mohokh67
mohokh67 / fix gitignore.md
Last active February 20, 2025 17:08
Fix the .gitignore and untrack files which are already added

Untrack files which are already added in gitignore file

  1. Commit all your changes

  2. Remove everything from the repository cache. Go to your repo directory and run this command.

git rm -r --cached .

It will only clear the cache. Your files and git history will stay.