Skip to content

Instantly share code, notes, and snippets.

View diversario's full-sized avatar
🏳️‍🌈

Ilya Shaisultanov diversario

🏳️‍🌈
View GitHub Profile
@diversario
diversario / cilium-repro.yaml
Created March 2, 2020 11:43
cilium-repro.yaml
---
apiVersion: v1
kind: Namespace
metadata:
name: host-network
labels:
name: host-network
---
apiVersion: v1
kind: Pod
provider "google-beta" {
project = "${var.project_id}"
region = "${var.region}"
credentials = "${file("~/.gcloud/my-project-terraform.json")}"
}
variable "project_id" {
default = "my-project"
description = "GCP project ID"
}
@diversario
diversario / asasdas
Last active February 18, 2019 00:39
asdasd
'{ InputSourceKind = "Keyboard Layout"; "KeyboardLayout ID" = 0; "KeyboardLayout Name" = "U.S."; }' '{ InputSourceKind = "Keyboard Layout"; "KeyboardLayout ID" = 19458; "KeyboardLayout Name" = RussianWin; }' '{ "Bundle ID" = "com.apple.CharacterPaletteIM"; InputSourceKind = "Non Keyboard Input Method"; }' '{ "Bundle ID" = "com.apple.KeyboardViewer"; InputSourceKind = "Non Keyboard Input Method"; }' '{ "Bundle ID" = "com.apple.50onPaletteIM"; InputSourceKind = "Non Keyboard Input Method"; }' '{ "Bundle ID" = "com.apple.inputmethod.TCIM"; "Input Mode" = "com.apple.inputmethod.TCIM.Pinyin"; InputSourceKind = "Input Mode"; }' '{ "Bundle ID" = "com.apple.inputmethod.TCIM"; InputSourceKind = "Keyboard Input Method"; }' '{ "Bundle ID" = "com.apple.inputmethod.ChineseHandwriting"; InputSourceKind = "Non Keyboard Input Method"; }' '{ "Bundle ID" = "com.apple.inputmethod.EmojiFunctionRowItem"; InputSourceKind = "Non Keyboard Input Method"; }'
@diversario
diversario / kubectl-stuff.sh
Created July 17, 2018 01:22
Useful kubectl one-liners
# get all evicted pods in the cluster
kubectl get pod --all-namespaces --field-selector status.phase=Failed --show-all -o json | jq -r '.items[] | select(.status.reason == "Evicted") | "\(.metadata.namespace)/\(.metadata.name)"'
@diversario
diversario / yaml-to-e.sh
Last active July 16, 2018 04:37
Format YAML map as docker cli env vars
yq -Mrj ' .envVars as $e | $e | keys | .[] | "-e \(.)=\($e[.]) "' deployment/values.yaml
function envvars() {
local selector=$1; shift
local files=($@)
if [[ -z $files ]]; then
files="${selector}"
selector=".envVars"
fi
import UIKit
class ViewController: UIViewController {
let tapGestureRecognizer: UITapGestureRecognizer! // make a variable to hold the recognizer
@IBOutlet weak var girImage: UIImageView! // add an outlet for your image view
override func viewDidLoad() {
super.viewDidLoad()
@diversario
diversario / robbyrussell.zsh
Created January 24, 2014 23:08
Display hostname in the prompt
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
PROMPT='%{$fg[blue]%}%n@%m ${ret_status}%{$fg_bold[green]%}%p%{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@diversario
diversario / keybase.md
Created July 25, 2017 01:07
keybase.md

Keybase proof

I hereby claim:

  • I am diversario on github.
  • I am diversario (https://keybase.io/diversario) on keybase.
  • I have a public key whose fingerprint is 550E 6997 3442 4812 1ED3 D22D 2764 461E CA81 0541

To claim this, I am signing this object:

@diversario
diversario / deinit.swift
Created May 14, 2016 05:54
log deinitialization of a node
class MyNode: SKSpriteNode {
// init et al
deinit {
print("MyNode \(name) destroyed.")
}
}
@diversario
diversario / impulse.swift
Created May 14, 2016 04:12
Impulse multipler
let SCREEN_SCALE = UIScreen.mainScreen().scale
private let FAKE_PX_TO_M_RATIO: CGFloat = 80
let IMPULSE = sqrt(
UIScreen.mainScreen().bounds.width *
SCREEN_SCALE * SCREEN_SCALE /
FAKE_PX_TO_M_RATIO
) * sqrt(SCREEN_SCALE) * 1.45