Skip to content

Instantly share code, notes, and snippets.

View lionello's full-sized avatar
🇭🇰

Lio李歐 lionello

🇭🇰
View GitHub Profile
@MainActor
final class AutocompleteObject: ObservableObject {
let delay: TimeInterval = 0.3
@Published var suggestions: [String] = []
init() {
}
@bgreenlee
bgreenlee / Versioning.sh
Last active June 13, 2022 16:42
Automatic project versioning for Xcode using git commits & tags #xcode #git
#!/bin/sh
# Versioning.sh
#
# https://gist.github.com/791352 by Marc Hedlund
#
# Found at http://kswizz.com/post/2686511526/git-xcode-versioning and slightly
# modified.
# To install:
@carlgieringer
carlgieringer / integration-request.vtl
Last active June 14, 2022 05:30
AWS API Gateway Integration Request Lambda Proxy (LAMBDA_PROXY) Velocity Template Language (VTL)
## MIT License
##
## Copyright (c) 2017 Carl Gieringer
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to deal
## in the Software without restriction, including without limitation the rights
## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
## copies of the Software, and to permit persons to whom the Software is
## furnished to do so, subject to the following conditions:
@harunpehlivan
harunpehlivan / index.html
Created August 17, 2019 10:35
Social Media Color Hex Codes
<div class="SocialMediaColors">
<div class="facebook-color fa fa-facebook"><span><br>Facebook<br>Hex: #3b5998</span></div>
<div class="twitter-color fa fa-twitter"><span><br>Twitter<br>Hex: #00aced</span></div>
<div class="GooglePlus-color fa fa-google-plus"><span><br>Google +<br>Hex: #dd4b39</span></div>
<div class="pinterest-color fa fa-pinterest"><span><br>Pinterest<br>Hex: #cb2027</span></div>
<div class="linkedin-color fa fa-linkedin"><span><br>Linkedin<br>Hex: #007bb6</span></div>
@cumet04
cumet04 / ec2-k3s-install-script.sh
Created August 17, 2019 14:57
k3s cloudinit script
#!/bin/bash
K3S_VERSION=v0.8.0
BIN_DIR=/usr/local/bin
# for master
#cat > /opt/k3s_env_put.sh << 'EOF'
##!/bin/bash
#
#ip=$(hostname | cut -d'.' -f1 | cut -d'-' -f2,3,4,5 | tr '-' '.')
@mmizutani
mmizutani / envoy-schema.json
Last active February 26, 2023 06:06 — forked from linux-china/envoy-schema.json
Envoy configuration json schema for Json and Yaml based on Envoy v1.20.1 (e9f36d2)
{
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"node": {
"properties": {
"id": {
"type": "string",
"description": "An opaque node identifier for the Envoy node. This also provides the local\n service node name. It should be set if any of the following features are\n used: :ref:`statsd <arch_overview_statistics>`, :ref:`CDS\n <config_cluster_manager_cds>`, and :ref:`HTTP tracing\n <arch_overview_tracing>`, either in this message or via\n :option:`--service-node`."
},
"cluster": {
@madhikarma
madhikarma / build_framework.sh
Created October 13, 2015 12:26
Script to build a framework for multiple architectures
# Merge Script
# http://code.hootsuite.com/an-introduction-to-creating-and-distributing-embedded-frameworks-in-ios/
# 1
# Set bash script to exit immediately if any commands fail.
set -e
# 2
# Setup some constants for use later on.
@yankcrime
yankcrime / k3s-aws-cloud-provider.md
Last active June 19, 2023 18:33
Auto-deploying the external AWS Cloud Provider when bootstrapping K3s

Installing K3s with the external ("out-of-tree") AWS Cloud Provider

Pre-requisites

Refer to the upstream project's official documentation for the various pre-requisites. You must have an IAM role with the right permissions attached to your K3s instances, and you must also tag your nodes with a clusterid. Refer to the Rancher documentation for how to do this

Install K3s with the following options:

curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server \
@cowlicks
cowlicks / Dockerfile
Last active September 11, 2023 19:23
Safely share your SSH access while building a Dockerfile using socat to forward ssh-agent's SSH_AUTH_SOCK
FROM python:3-stretch
COPY . /app
WORKDIR /app
RUN mkdir -p /tmp
# install socat and ssh to talk to the host ssh-agent
RUN apt-get update && apt-get install git socat openssh-client \
# create variable called SSH_AUTH_SOCK, ssh will use this automatically
@aheissenberger
aheissenberger / timemachine.sh
Last active September 30, 2023 10:19
Exclude package folder e.g. node_modules from being backuped by MacOS Time Machine
#!/bin/sh
#set -x
EXCLUDEFOLDERNAME=${3:-"node_modules"}
get_realpath ()
{
echo "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
}
SEARCHPATH="$(get_realpath ${2:-"${HOME}"})"