Skip to content

Instantly share code, notes, and snippets.

View karstengresch's full-sized avatar
:octocat:
.

Karsten Gresch karstengresch

:octocat:
.
View GitHub Profile
@wpmudev-sls
wpmudev-sls / forminator-skip-steps-in-pagination-form.php
Last active July 27, 2024 02:30
Forminator - Skip Steps in Pagination Form
<?php
/**
* Plugin Name: [Forminator] Skip Steps in Pagination Form
* Plugin URI: https://premium.wpmudev.org
* Description: With this snippet and some extra configurations in your form is possible to skip steps according to user-selected choices in a control field - works with checkboxes, radio buttons and selects.
* Author: Glauber Silva @ WPMUDEV
* Author URI: https://premium.wpmudev.org
* Jira Task: FOR-428 and SLS-263 and SLS-2035
* License: GPLv2 or later
*
@rbo
rbo / bassh_rc_snippet.sh
Last active September 23, 2022 19:26
powerline-go
# https://github.com/justjanne/powerline-go
if [ -x "$(command -v powerline-go)" ]; then
function _update_ps1() {
rc=$?
if [ -x "$(command -v powerline-go)" ]; then
PS1="$(powerline-go -error $rc -max-width 80 -newline -colorize-hostname -modules "ssh,host,user,cwd,perms,git,kube,exit" -priority "ssh,host,cwd,exit,git,kube" -modules-right "time" )"
else
PS1="\u@\h:\w $ "
fi
}
@jevakallio
jevakallio / readme.md
Last active June 20, 2025 08:25
`adb pull` from app data directory without root access

TL;DR;

com.package.name is your app identifier, and the file path is relative to the app user's home directory, e.g. '/data/user/0/com.package.name.

adb shell run-as com.package.name cp relative/path/file.ext /sdcard
adb pull /sdcard/file.ext

See long explanation below.

@rbo
rbo / Podman-on-MacOS.md
Last active September 1, 2021 13:42
Podman on Mac OS
$ export PATH=$(pwd):$PATH
$ podman-machine create box
Podman machine "box" already exists
$ podman-machine start box
Starting "box"...
@karstengresch
karstengresch / 3scale_Install.asciidoc
Created March 26, 2019 21:13 — forked from gsaslis/3scale_Install.asciidoc
Deploy 3scale API Management on Minishift

Installing 3scale on your Laptop

Pre-requisites

.or your desktop. Or a VM in the cloud. Or wherever it is you want to deploy 3scale to start exploring!
  • ❏ Minishift: 3scale is currently targeted for deployment on openshift, and minishift is the recommended development environment for that.

  • oc command-line tool [optional. you can also use the web-based interface.]

tl;dr

@gsaslis
gsaslis / 3scale_Install.asciidoc
Last active December 18, 2023 19:37
Deploy 3scale API Management on Minishift

Installing 3scale on your Laptop

Pre-requisites

.or your desktop. Or a VM in the cloud. Or wherever it is you want to deploy 3scale to start exploring!
  • ❏ Minishift: 3scale is currently targeted for deployment on openshift, and minishift is the recommended development environment for that.

  • oc command-line tool [optional. you can also use the web-based interface.]

tl;dr

@Rich-Harris
Rich-Harris / what-is-svelte.md
Last active November 13, 2025 01:35
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

@AD-Paladins
AD-Paladins / TextViewPinchToZoom.swift
Last active February 3, 2020 13:47
How to use add pinch-to-zoom to a TextView (Swift)
var pinchGestureRecognizer : UIPinchGestureRecognizer!
override func viewDidLoad() {
super.viewDidLoad()
pinchGestureRecognizer = UIPinchGestureRecognizer(target: self, action: #selector(pinchGesture))
self.textView.addGestureRecognizer(pinchGestureRecognizer)
}
@objc func pinchGesture(gestureRecognizer: UIPinchGestureRecognizer ) {
@jamesfalkner
jamesfalkner / istio-coolstore.sh
Created March 14, 2018 21:33
Hack to install istio to OpenShift and deploy coolstore-microservice as an istio service mesh
#!/bin/bash
# This script will install istio and the coolstore-microservice demo as a service mesh.
# It does everything as a cluster-admin user because istio (the project) still needs it to
# work. Future versions will not require so many permissions!
#
# Maintainer: James Falkner <[email protected]>
#
# Prereqs:
#
@karstengresch
karstengresch / gist:2a81245a5caeb6b963d035a9ae452c16
Created January 12, 2018 20:24
Swift 4: UIColor(hex: String) extension
// Inspired by https://stackoverflow.com/questions/24263007/how-to-use-hex-colour-values, merging Swift 4 + extension examples
extension UIColor {
convenience init (hex:String) {
var cString:String = hex.trimmingCharacters(in: .whitespacesAndNewlines).uppercased()
if (cString.hasPrefix("#")) {
cString.remove(at: cString.startIndex)
}