Skip to content

Instantly share code, notes, and snippets.

View danzig666's full-sized avatar

Danzig danzig666

View GitHub Profile
@danzig666
danzig666 / gist:c01cb130537b676ff548b1f45d485c14
Created July 6, 2023 08:53
Rasterize PDF files with Ghostscript and ImageMagick - Windows batch file version
@echo off
REM Rasterize PDF files with Ghostscript and ImageMagick.
setlocal
set DENSITY=600
set ADDEXT=.raster
REM parse options
if "%~1"=="-d" (
@danzig666
danzig666 / nCore++.user.js
Created March 21, 2022 14:31
nCore++ 2022-03
// ==UserScript==
// @name nCore++
// @namespace nyuszika7h@gmail.com
// @version 0.3.5
// @description Various improvements to nCore
// @author nyuszika7h/Danzig
// @match https://ncore.pro/*
// @grant GM.xmlHttpRequest
// ==/UserScript==
/* globals $ */
@danzig666
danzig666 / geopackage_whole_project.py
Created August 11, 2020 09:22
Save whole QGIS project to geopackage
# input: all layers
# save path: save_layerpath project property / current project majority path
# replaces all postgis datasources with gpkg!
##########################
from qgis.utils import iface
from qgis.core import *
from qgis.PyQt.QtWidgets import *
from PyQt5.QtCore import *
from processing.tools import dataobjects
@danzig666
danzig666 / split_poly.py
Created June 17, 2020 13:40
Polygon Splitter QGIS script
"""
Splitting polygons into equal area parts
converted to qgis3 from https://github.com/csandor/polygonsplitter
"""
#from __future__ import print_function
#from builtins import str
#from builtins import object
from qgis.core import * #(QgsFeature, QgsGeometry,
#QgsVectorLayer, QgsMapLayerRegistry,
#QgsField,/)
@danzig666
danzig666 / pyqgis_eov_szelveny.py
Created September 6, 2019 07:21
QGIS - Calculate EOV section from EOV coordinates
leptek = ['M 1:100000','M 1:50000','M 1:25000','M 1:10000', 'M 1:4000','M 1:2000','M 1:1000','M 1:500','M 1:250']
#1: 100000 #2: 50000 #3: 25000 #4: 10000 #5: 4000 #6: 2000 #7: 1000 #8: 500 #9: 250
#leptek m:
m=6
def eov_coord_to_szelveny(x,y):
#y=844116.87 #720750.0 #test coord
#x=246253.3 #278500.0 #test coord
dy = 48000.0
dx = 32000.0
@danzig666
danzig666 / pdfcoloursplitter.py
Created October 18, 2018 07:24 — forked from dalemyers/pdfcoloursplitter.py
PDF Colour Splitter
#!/usr/bin/env python
# Python 2 and 3 compatible.
#This script takes in a PDF and creates two new PDFs. One has the black and
#white pages and the other has the colour pages. It also takes duplex printing
#into account. So a black and white side which is on the same sheet as a colour
#side will be placed into the colour PDF.
#This is from a script created by Iain Murray. The original comment is below.
#This version simply has some different defaults and removes the PDFtoPPM.
@danzig666
danzig666 / main.py
Created October 18, 2015 17:35
Move all your torrents in QBittorrent
# Copyright (c) 2015, Jimmy Zelinskie.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
@danzig666
danzig666 / resumedat_qBittorent330beta.rb
Last active December 19, 2022 12:00
Ruby script for migrating from uTorrent to qBittorrent 3.3.x beta
# encoding: utf-8
# USE AT OWN RISK
#
# Follow this guide to install Ruby on Windows (step 1 and 2): https://forwardhq.com/support/installing-ruby-windows
# Install gems (with admin cmd prompt):
# https://rubygems.org/gems/bencode
# https://rubygems.org/gems/rest_client
#
# Edit datpath below to point to your utorrent resume.dat file
# encoding: utf-8
# USE AT OWN RISK
#
# Follow this guide to install Ruby on Windows (step 1 and 2): https://forwardhq.com/support/installing-ruby-windows
# Install gems (with admin cmd prompt):
# https://rubygems.org/gems/bencode
# https://rubygems.org/gems/rest_client
#
# Edit datpath below to point to your utorrent resume.dat file