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
--[[ | |
A simple function to print tables or to write tables into files. | |
Great for debugging but also for data storage. | |
When writing into files the 'return' keyword will be added automatically, | |
so the tables can be loaded with 'dofile()' into a variable. | |
The basic datatypes table, string, number, boolean and nil are supported. | |
The tables can be nested and have number and string indices. | |
This function has no protection when writing files without proper permissions and | |
when datatypes other then the supported ones are used. | |
--]] |
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
hi org guifg=#FD971F guibg=#232526 gui=bold | |
sign define Warn text=! texthl=org | |
function! LintSign() | |
let Messages_l = [] | |
let SignIDCnt = 0 | |
" capture splint output as list | |
let LintOutput_l=systemlist("splint *.c") | |
" remove all previously placed signs | |
sign unplace * |
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
function! LintBalloon() | |
let BalloonText_l = [] | |
" read lint output into a list | |
let LintOutput_l=readfile("project.lnt") | |
" iterate through list | |
for line in LintOutput_l | |
" find the message lines and capture the pure message (here for standard gcc format) | |
let Match_l = matchlist(line, '^' . expand('%:.') . ':' . v:beval_lnum .':\d\+: \(.*\)') | |
if len(Match_l) != 0 " if match | |
" add all matching lines to list |
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
set balloonexpr=Balloon() | |
let g:BalloonScript="<scriptname>" | |
set ballooneval | |
function! Balloon() | |
let balloondata = ['return', '{'] | |
call add(balloondata, " ['cwd'] = [[" . getcwd() . "]],") | |
call add(balloondata, " ['fileabspath'] = [[" . expand('%:p') . "]],") | |
call add(balloondata, " ['filerelpath'] = [[" . expand('%:.') . "]],") | |
call add(balloondata, " ['fileabsdir'] = [[" . expand('%:p:h') . "]],") |
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
-- load the log module | |
local log = require("log") | |
-- some function for demo | |
function add(a, b) | |
return a+b | |
end | |
-- wrap the main script in a main function | |
function main() |
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
#!/usr/bin/env bash | |
if [[ -z "$(file -b "${1}" | grep -o '1024 x 1024')" ]] ; then | |
echo "ensure PNG size is 1024x1024 pixels" | |
exit 1 | |
fi | |
TmpDir="/tmp/png2icns.iconset" | |
mkdir -p "${TmpDir}" | |
sips -z 16 16 "${1}" --out "${TmpDir}/icon_16x16.png" | |
sips -z 32 32 "${1}" --out "${TmpDir}/[email protected]" | |
sips -z 32 32 "${1}" --out "${TmpDir}/icon_32x32.png" |
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
#!/bin/bash | |
# save tool paths in variables | |
CocoaDialog='/Applications/cocoaDialog.app/Contents/MacOS/cocoaDialog' | |
YoutubeDL='/usr/local/bin/youtube-dl' | |
# get clipboard content | |
Clipboard=$(pbpaste) | |
# run youtube-dl |
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
#!/bin/bash | |
# extend PATH variable; dirty workaround for the audio extraction feature which requires ffmpeg | |
PATH=$PATH:/usr/local/bin | |
# save tool paths in variables | |
CocoaDialog='/Applications/cocoaDialog.app/Contents/MacOS/cocoaDialog' | |
YoutubeDL='/usr/local/bin/youtube-dl' | |
# get clipboard content |
OlderNewer