Skip to content

Instantly share code, notes, and snippets.

@zhjuncai
zhjuncai / z_demo_structdescr.abap
Last active March 19, 2024 03:39
abap demo use of cl_abap_structdescr to get list of structure component definition
*&---------------------------------------------------------------------*
*& report z_demo_structdescr
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
report z_demo_structdescr.
@zhjuncai
zhjuncai / cert-manager-test.sh
Created March 13, 2023 02:06 — forked from jakexks/cert-manager-test.sh
Cert-manager selfsigned as cluster issuer
#!/usr/bin/env bash
set -ex
export TEST_CLUSTER_NAME=quick-test
export CERT_MANAGER_VERSION=v1.3.1
export KIND_IMAGE=kindest/node:v1.20.2
# Create test cluster
echo "Creating test cluster..."
kind create cluster --name="$TEST_CLUSTER_NAME" --image="$KIND_IMAGE"
until kubectl --timeout=120s wait --for=condition=Ready pods --all --namespace kube-system; do sleep 1; done
@zhjuncai
zhjuncai / gist:d69ca307a1d62635f457e796be855265
Created December 27, 2022 14:21 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@zhjuncai
zhjuncai / OSX UTC Time Zone
Created November 14, 2019 07:12 — forked from nick-desteffen/OSX UTC Time Zone
Set Time zone in OSX to UTC
sudo ln -sf /usr/share/zoneinfo/UTC /etc/localtime
@zhjuncai
zhjuncai / Jenkinsfile
Created November 8, 2019 13:46 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples
DEFAULT_PROXY=http://proxy:8083
PROXY_SERVER=proxy.domain.com
PROXY_PORT=8080
SERVICE_NAME=Wi-Fi
if [[ $1 == "default" ]]; then
sudo networksetup -setautoproxystate $SERVICE_NAME on
sudo networksetup -setproxyautodiscovery $SERVICE_NAME on
@zhjuncai
zhjuncai / schema.sql
Created April 29, 2018 08:46 — forked from fernandomantoan/schema.sql
Schema for PostgreSQL to use with JdbcTokenStore (Spring Security OAuth2)
create table oauth_client_details (
client_id VARCHAR(256) PRIMARY KEY,
resource_ids VARCHAR(256),
client_secret VARCHAR(256),
scope VARCHAR(256),
authorized_grant_types VARCHAR(256),
web_server_redirect_uri VARCHAR(256),
authorities VARCHAR(256),
access_token_validity INTEGER,
refresh_token_validity INTEGER,
@zhjuncai
zhjuncai / HTTPStatusCode.swift
Created February 6, 2017 15:43 — forked from ollieatkinson/HTTPStatusCode.swift
HTTP status codes as a Swift enum.
/// This is a list of Hypertext Transfer Protocol (HTTP) response status codes.
/// It includes codes from IETF internet standards, other IETF RFCs, other specifications, and some additional commonly used codes.
/// The first digit of the status code specifies one of five classes of response; an HTTP client must recognise these five classes at a minimum.
enum HTTPStatusCode: Int, Error {
/// The response class representation of status codes, these get grouped by their first digit.
enum ResponseType {
/// - informational: This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line.
case informational
@zhjuncai
zhjuncai / JSONTest.js
Last active October 17, 2017 10:48
SAPUI5 JSONModel Test case example
test("test JSONModel destroy", function(){
var testModel = new sap.ui.model.json.JSONModel();
testModel.attachRequestCompleted(function() {
ok(false, "Request should be aborted!");
});
testModel.attachRequestFailed(function() {
ok(false, "Error handler should not be called when request is aborted via destroy!");
});
var spy = this.spy(jQuery, "ajax");
testModel.loadData("testdata.json");
@zhjuncai
zhjuncai / rex.swift
Created February 23, 2016 15:04 — forked from erica/rex.swift
import Foundation
// Extend String to support regex searching by conforming
// to CustomStringConvertible
extension String: CustomStringConvertible {
public var description: String {return self}
}
// Regex support for keys
public extension Dictionary where Key: CustomStringConvertible {