Skip to content

Instantly share code, notes, and snippets.

View mipmip's full-sized avatar
🐟

Pim Snel mipmip

🐟
View GitHub Profile
@mipmip
mipmip / gist:048df12ad2f6c22ba6e8db4ee6eb005e
Created April 22, 2022 09:38
docker-mysq-exec-on-liner
export $(cat .env | xargs) && docker-compose exec -T mysql mysql -p$MYSQL_PASS <<< "show databases\G"
@mipmip
mipmip / focus_next_horizontal_client.lua
Created December 10, 2020 21:28
AwesomeWM config fragment: Jump to previous/next screen when last left/right client
-- begin extract
awful.key({modkey}, "Left",
function()
focus_next_horizontal_client("left")
end,
{description = "focus left", group = "client"}
),
awful.key({modkey}, "Right",
function()
focus_next_horizontal_client("right")
@mipmip
mipmip / install_overmind.sh
Created November 28, 2019 21:31
oneliner to install overmind on linux
curl -SL https://github.com/DarthSim/overmind/releases/download/v2.0.3/overmind-v2.0.3-linux-amd64.gz | sudo gunzip > ./overmind && sudo chmod +x ./overmind & sudo mv ./overmind /usr/local/bin
@mipmip
mipmip / saveas.vim
Last active September 18, 2019 16:16
Vim mapping: saveas with proposed new filename populated in Ex-mode
function! s:saveas()
return ":saveas ". expand("%:r") . "_COPY." .expand("%:e")
endfunction
nnoremap <expr> <leader>sa <SID>saveas()
@mipmip
mipmip / markdown.vim
Created June 26, 2019 22:53
after/ftplugin/markdown.vim - folding markdown with nested frontmatter yaml
" Overwrite default Markdown Fold function
function! MarkdownFold()
let line = getline(v:lnum)
" Regular headers
let depth = match(line, '\(^#\+\)\@<=\( .*$\)\@=')
if depth > 0
return ">" . depth
endif
@mipmip
mipmip / index.html
Created June 5, 2018 16:16
Custom publish button inside Netlify CMS
<head>
<link href="https://unpkg.com/netlify-cms/dist/cms.css" rel="stylesheet"/>
</head>
<body>
<script src="https://unpkg.com/netlify-cms/dist/cms.js"></script>
<script>
var PublishControl = createClass({
handleClick: function(e) {
@mipmip
mipmip / .gitlab-ci.yml
Created January 5, 2018 01:03
gitlab-ci.yml with blackbox for decrypting secrets
image: "ruby:2.4"
simple_test:
script:
- apt-get update -qq && apt-get -yqq install gnupg2
- git clone https://github.com/mipmip/blackbox
- cd blackbox
- make manual-install
- cd ..
- gpg -v --import <(echo "$GPG_PRIVATE_KEY")
@mipmip
mipmip / debug_scheduler_with_typo3_console.sh
Created March 7, 2017 08:57
debug scheduler with typo3_console
# Check the Id of the job you want to debug in the typo3 backend
# cd to the TYPO3 document root
# Then run:
./typo3cms scheduler:run --task-id 4 --force
@mipmip
mipmip / images_to_word_with_headings.scpt
Created December 7, 2016 20:51
Insert Images in Word Document adds image title as heading inserts a page break
on basename(thePath) -- Requires POSIX path
if thePath ends with "/" then
set nameIndex to -2
else
set nameIndex to -1
end if
set ASTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to "/"
set thePath to text item nameIndex of thePath
set AppleScript's text item delimiters to ASTID
@mipmip
mipmip / convert vimbuffer with Markdown to word
Last active November 24, 2016 10:52
Write and convert vim buffer with markdown content to Word doc.
map <silent> ,w :silent w<CR> :!pandoc '%' -o '%.docx'<CR><CR>