Skip to content

Instantly share code, notes, and snippets.

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

Karsten Gresch karstengresch

:octocat:
.
View GitHub Profile
@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 March 27, 2024 06:09
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 <jfalkner@redhat.com>
#
# 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)
}
<?php
/**
* Add meta fields support in rest API for post type `Post`
*
* This function will allow custom parameters within API request URL. Add post meta support for post type `Post`.
*
* > How to use?
* http://mysite.com/wp-json/wp/v2/posts?meta_key=<my_meta_key>&meta_value=<my_meta_value>
*
* > E.g. Get posts which post meta `already-visited` value is `true`.
@DivineDominion
DivineDominion / cocoaconv.rb
Last active September 28, 2018 12:09
Convert libMultiMarkdown enums to Swift-bridgeable NS_ENUMs. Pass the path to libMultiMarkdown.h to the script when running.
#!/usr/bin/env ruby
require 'optparse'
CURRENT_PATH = File.expand_path(File.dirname(__FILE__))
FALLBACK_PATH = File.join(CURRENT_PATH, "..", "build-xcode", "Debug", "include", "libMultiMarkdown", "libMultiMarkdown.h")
options = {:mode => :nsenum}
OptionParser.new do |parser|
parser.banner = "Usage: #{$0} [options] path/to/libMultiMarkdown.h"
@480
480 / gist:3b41f449686a089f34edb45d00672f28
Last active May 6, 2024 19:52
MacOS X + oh my zsh + powerline fonts + visual studio code terminal settings

MacOS X + oh my zsh + powerline fonts + visual studio code (vscode) terminal settings

Thank you everybody, Your comments makes it better

Install oh my zsh

http://ohmyz.sh/

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
@debovis
debovis / package.json
Last active January 16, 2024 14:13
How to debug gatsby and reactjs with webstorm
{
"name": "project-name",
"version": "1.0.0",
"description": "",
"main": "n/a",
"scripts": {
"serve": "gatsby develop -p 5000",
"dev": "node $NODE_DEBUG_OPTION ./node_modules/.bin/gatsby develop -p 5000",
}
}
@VlooMan
VlooMan / Highlight CPT Archive and wp_nav_menu parents
Last active May 23, 2023 17:15
Highlight the CPT (Custom Post Type) Archive & its Parents ("current-menu-parent") & its Ancestors ("current-menu-ancestor") in the WordPress Navigation wp_nav_menu() when viewing the Archive itself or a single detail page of the CPT. Let's say you have CPT called "projects" and you have a WordPress menu set as "My Work (link to a page) > Projec…
/**
* Gist Name: Highlight CPT Archive and wp_nav_menu parents
* Author: VlooMan
* Author URI: http://ishyoboy.com
*
* Highlight the CPT (Custom Post Type) Archive & its Parents ("current-menu-parent")
* & its Ancestors ("current-menu-ancestor") in the WordPress Navigation wp_nav_menu() when viewing the Archive itself
* or a single detail page of the CPT.
*
* Let's say you have CPT called "projects" and you have a WordPress menu set as