Skip to content

Instantly share code, notes, and snippets.

View christianjunk's full-sized avatar

Christian Junk christianjunk

View GitHub Profile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@christianjunk
christianjunk / Code.cs
Created February 28, 2023 10:24 — forked from xt0rted/Code.cs
C# port of Bitwarden's random password algorithm
void Main()
{
var options = new PasswordOptions
{
Length = 13,
MinLowercase = 2,
MinNumbers = 2,
MinSpecial = 1,
MinUppercase = 2,
UseLowercase = true,
using System;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
namespace TestConsole
{
// From https://stackoverflow.com/a/41392145/4213397
@christianjunk
christianjunk / obsidian-web-clipper-yaml.js
Last active January 5, 2022 08:44 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@christianjunk
christianjunk / globalmaptiles.py
Created August 8, 2021 12:58 — forked from maptiler/globalmaptiles.py
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/
@christianjunk
christianjunk / post-receive
Created April 21, 2020 15:03 — forked from fettlaus/post-receive
Jekyll Git-Auto-Publisher. Werte ersetzen und im Server-Repo in Verzeichnis $repository/.git/hooks/post-receive einfügen.
#!/bin/sh
# Die folgende Variable speichert den Pfad zum Repository um das es geht.
# Hier meinprojekt.git mit dem Namen Deines Repos ersetzen und ggfs.
# den Pfad zum Repo
GIT_REPO=$HOME/git/meinprojekt.git
# Die folgende Variable speichert den Pfad zum tmp Ordner in dem dann der Jekyll
# Befehl ausgeführt wird um die deine Seite in den Webroot zu befördern.
# Hier wieder "meinprojekt" mit dem Namen des Repos ersetzen ohne ".git" am Schluss.
TMP_GIT_CLONE=$HOME/tmp/meinprojekt
@christianjunk
christianjunk / github-to-bitbucket
Last active May 22, 2019 12:33 — forked from sangeeths/github-to-bitbucket
Forking a Github repo to Bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone git@bitbucket.org:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync git@github.com:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v
@christianjunk
christianjunk / readinglist.py
Last active August 30, 2018 15:02 — forked from mpraglowski/readinglist.py
Export Safari Reading List bookmarks to pinboard
#!/usr/bin/env python
"""
forked from http://alexwlchan.net/2015/11/export-urls-from-safari-reading-list/
Requires Python 3.
"""
import os
import plistlib
INPUT_FILE = os.path.join(os.environ['HOME'], 'Library/Safari/Bookmarks.plist')
@christianjunk
christianjunk / 0_reuse_code.js
Created June 23, 2016 10:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
/// <summary>
/// Non-Generic BaseForm. Provides functionality for retrieving the controller.
/// </summary>
public class BaseForm : Form
{
/// <summary>
/// Gets the controller for the given type.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>