This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update_secret() { | |
# Uses yq and kubectl: | |
# https://mikefarah.gitbook.io/yq/ | |
local SECRET=$(kubectl get secret $1 -o yaml) || echo "error" | |
local YAML=$(echo $SECRET | yq '.data[] |= @base64d') | |
local TMP=$(mktemp /tmp/secret.XXXXXXXXXXX.yaml) | |
echo $YAML > $TMP | |
$EDITOR $TMP | |
cat $TMP | yq '.data[] |= @base64' | kubectl apply -f - | |
rm $TMP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const YAML = require('yaml') | |
fs = require('fs'); | |
const exec = require('child_process').execSync; | |
const filenames = []; | |
function fromDir(startPath, filter) { | |
if (!fs.existsSync(startPath)) { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Install packer | |
local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim' | |
local is_bootstrap = false | |
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then | |
is_bootstrap = true | |
vim.fn.execute('!git clone https://github.com/wbthomason/packer.nvim ' .. install_path) | |
vim.cmd [[packadd packer.nvim]] | |
end | |
-- stylua: ignore start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Thing</title> | |
<link rel="preconnect" href="https://fonts.googleapis.com" /> | |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> | |
<link | |
href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@100;200;300;400;500;600;700;800;900&display=swap" | |
rel="stylesheet" | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { differenceInMilliseconds, differenceInSeconds } from "date-fns"; | |
export class Cache { | |
constructor({ minInterval = 1000 }) { | |
this.minInterval = minInterval; | |
this._map = new Map(); | |
} | |
// Key could be an item here | |
check = (key) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const util = require("util"); | |
const { performance } = require("perf_hooks"); | |
// Input data is like this | |
const exampleInput = [ | |
{ 9668: { "Fa0/11": { in_traffic: "1000" } } }, | |
{ 9668: { "Fa0/11": { out_traffic: "900" } } }, | |
{ 9628: { "Fa0/16": { in_traffic: "800" } } }, | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::USAGE | |
::Make a start-tekken.bat file and paste the contents of this file inside of it. | |
::Replace the gamePath folder value with your TEKKEN 7 folder location. | |
::Example: | |
::set gamePath=C:\Program Files (x86)\Steam\steamapps\common\TEKKEN 7 for the default TEKKEN 7 install. | |
@echo off | |
set gamePath=C:\Program Files (x86)\Steam\steamapps\common\TEKKEN 7 | |
IF EXIST "%gamePath%\TekkenGame\Content\Movies\Gallery" ( | |
echo Removing Gallery folder... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Person = function (name, yearOfBirth, job) { | |
this.name = name; | |
this.yearOfBirth = yearOfBirth; | |
this.job = job; | |
//This | |
this.calculateAge = function () { | |
console.log(2018 - this.yearOfBirth); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
namespace SongEncoder | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |