- Go to Tools > New Plugin
- Paste timestamp.py contents and save in User as timestamp.py
- Open Preferences > Key Bindings - User (or Default, your call)
- Paste keybindings.json, or add a line to your keybindings
- Customize the keyboard shortcut to your liking and save
This file contains hidden or 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
javascript:(function() { | |
const categories = Object.fromEntries(Array.from(document.querySelectorAll("#idSkillCategoryId > option")).map(option => [option.value, option.text])); | |
const separator = "\t"; /* Yeah, tab separated CSV. Deal with it.*/ | |
const tsvHeader = ["skillname", "category", "lastresult", "pr", "tries", "daysince"].join(separator); | |
const tsvData = personResults.resultSet.map(res => [res.skillname, categories[res.categoryid],res.lastresult, res.pr, res.tries, res.daysince].join(separator)); | |
const tsvContent = [tsvHeader].concat(tsvData).join("\n"); | |
const blob = new Blob([tsvContent], { type: 'text/csv' }); | |
/* Initiate download of CSV data */ |
This file contains hidden or 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
#!/bin/bash | |
set -e | |
function listContexts() { | |
kubectl config get-contexts | sed -e 's/^ /off/' -e 's/^\*/on/' -e 1d | awk '{printf("%i\n%s\n", (NR-1),$2)}' | |
} | |
# https://stackoverflow.com/questions/11426529/reading-output-of-a-command-into-an-array-in-bash | |
IFS=$'\n' read -r -d '' -a contexts < <( listContexts && printf '\0' ) |
This file contains hidden or 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
#!/bin/bash | |
set -e | |
selected=$( | |
dialog --radiolist "Choose cluster" 0 0 0 $( | |
kubectl config get-contexts | sed -e 's/^ /off/' -e 's/^\*/on/' -e 1d | awk '{print $2,$3,$1 }' | |
) 2>&1 > /dev/tty | |
) |
This file contains hidden or 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
from dataclasses import dataclass | |
import pathlib | |
import yaml | |
from operator import itemgetter | |
YAML_SUFFIX_LENGTH = len('.yaml') | |
@dataclass | |
class Component: | |
building_block: str |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
from datetime import datetime | |
import time | |
import sublime_plugin | |
class TimestampCommand(sublime_plugin.EventListener): | |
"""Expand `isoD`, `now`, `datetime`, `utcnow`, `utcdatetime`, | |
`date` and `time` |
This file contains hidden or 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
%YAML 1.2 | |
--- | |
# See http://www.sublimetext.com/docs/3/syntax.html | |
name: relatorio | |
file_extensions: [md] | |
scope: text.html.markdown | |
contexts: | |
main: | |
- match: '\b(PENDING)\b' | |
scope: keyword.control.c |
This file contains hidden or 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
#!/bin/bash | |
export ELASTICSEARCH_ENDPOINT="http://localhost:9200" | |
# Create indexes | |
# DELETE indexes consecutive tests | |
curl -XDELETE "$ELASTICSEARCH_ENDPOINT/play" | |
curl -XPUT "$ELASTICSEARCH_ENDPOINT/play" -d '{ |
This file contains hidden or 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
# just in case | |
curl -XDELETE http://localhost:9200/inall | |
curl -XPUT http://localhost:9200'/inall/' -d '{ | |
"mappings": { | |
"thing": { | |
"include_in_all": false, | |
"type": "object", | |
"_all" : { |
This file contains hidden or 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
" Sample .vimrc file by Martin Brochhaus | |
" Presented at PyCon APAC 2012 | |
" ============================================ | |
" Note to myself: | |
" DO NOT USE <C-z> FOR SAVING WHEN PRESENTING! | |
" ============================================ | |
NewerOlder