Skip to content

Instantly share code, notes, and snippets.

@torsak
torsak / ksecret
Created October 22, 2021 09:00
k8s reveal secret
#!/bin/bash
if [ $3 ]
then
kubectl get secret/$1 -n $3 -o jsonpath="{.data.$2}" | base64 -d
else
kubectl get secret/$1 -o jsonpath="{.data.$2}" | base64 -d
fi
@torsak
torsak / conv_utf8.php
Created June 22, 2017 08:38
Cleaning the string before passing it to json_encode()
/**
* Cleaning the string before passing it to json_encode
* @link https://stackoverflow.com/a/29667430/2239441
* @param string $text
* @return string
*/
function conv_utf8($text)
{
$encoding = mb_detect_encoding($text, mb_detect_order(), false);
if ($encoding === 'UTF-8') {
<!DOCTYPE html>
<html ng-app="TorApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
.calendar .row:after {
display: table;
content: " ";
<!DOCTYPE html>
<html ng-app="TorApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
.calendar .row:after {
display: table;
content: " ";
<!DOCTYPE html>
<html ng-app="KDApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body ng-controller="CalCtrl">
<table border="1">
<tr ng-repeat="week in datesGroupedByWeek">