Skip to content

Instantly share code, notes, and snippets.

@tamboer
tamboer / bashrc-aliasses.sh
Created September 25, 2020 16:21
common aliasses and bashrc profile addons
# show weather
alias weather='curl wttr.in/Waregem'
alias weer='function _weer(){ echo "Getting weather for $1"; curl wttr.in/$1; };_weer'
# Which commands do I use the most?
alias histstats="history | awk '{CMD[\$2]++;count++;}END { for (a in CMD)print CMD[a] \" \" CMD[a]/count*100 \"% \" a;}' | grep -v './' | column -c3 -s ' ' -t | sort -nr | nl | head -n10"
# like `history` but with dates
alias h="fc -li 1"
@tamboer
tamboer / youtube-dl-install.md
Created September 25, 2020 16:19
youtube-dl install
@tamboer
tamboer / datetime.py
Created September 25, 2020 15:28
sublime.datetime.py
import sublime, sublime_plugin, time
class InsertDatetimeCommand(sublime_plugin.TextCommand):
def run(self, edit):
sel = self.view.sel();
for s in sel:
self.view.replace(edit, s, time.ctime())
@tamboer
tamboer / alias-function-for-weather
Created August 7, 2020 08:24
alias function for weather
alias weer='function _weer(){ echo "Getting weather for $1"; curl wttr.in/$1; };_weer'
#!/bin/bash
GIST_ID=${1}
cd ~/bin
git clone https://gist.github.com/${GIST_ID}.git
for entry in "$GIST_ID"/*
do
@tamboer
tamboer / README.md
Created August 3, 2020 11:18 — forked from roachhd/README.md
a quick-and-dirty guide to Vim.

a quick-and-dirty guide to Vim

![][1]

In the world of text editors, there's a plethora of options out there. If you've ever Googled "how to edit HTML sites" or some such, you know what we mean. Allow us, then, to introduce you to VIM, a free website editor that offers many of the same features as Adobe Dreamweaver, and runs on just about every desktop platform. Specifically, it comes by default on the vast majority of Linux distributions, OS X and commercial Unix systems. (It's available to install on Windows, too.) And did we mention it's free? That command line UI isn't necessarily self-explanatory, though, so join us after the break for a quick crash course to help you get started.

Getting started

If you're running OS X or Linux, start out by opening a terminal. Now type "vim" et voilà: you're using VIM and you didn't even install it. Using Windows? Head over [here][2] and grab the binaries for Windows. Double-click the installer and you'll have VIM on Windows in no time.

@tamboer
tamboer / gist:49c6738c23c161b824ad8e1ce7d6df9f
Created August 3, 2020 10:59 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@tamboer
tamboer / bash-shell-color-changer.sh
Created June 27, 2020 09:08
bash-shell-color-changer.sh
//https://askubuntu.com/questions/809590/automatically-get-different-terminal-colors-each-time-i-open-terminal
//add to .bashrc
#Change color according to the number of Bash shells opened
#Creates the .Bash_Color_Changer file if it's not present
if ! [ -f ~/.Bash_Color_Changer ]; then
echo ORIGINAL > ~/.Bash_Color_Changer
fi
#Array holding the name of the profiles: Substitute it for the names you're using
@tamboer
tamboer / ExportTableHeaders.p
Created June 26, 2020 20:44 — forked from johanvergeer/ExportTableHeaders.p
Progress OpenEdge Export column names
/*------------------------------------------------------------------------
File : Export table headers
Purpose : Gist for exporting table headers in Progress OpenEdge
Description :
Author(s) : Johan Vergeer. With thanks to TheDropper at
https://stackoverflow.com/questions/44204335/how-to-add-column-name-while-export-csv-in-progress-4gl#44205839
Created : 6 december 2017
----------------------------------------------------------------------*/
DEF VAR hTable AS HANDLE NO-UNDO.
@tamboer
tamboer / DeviceControllerTest.java
Created May 23, 2018 07:22
Test with sql queries.
@Test
@Sql(scripts = {"/create_devices.sql"}, executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD)
@Sql(scripts = {"/remove_devices.sql"}, executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
public void create_shouldFailWhenTheSameDeviceIsAddedASecondTime() throws Exception {
final ResultActions secondResultActions = mockMvc.perform(post("/devices")
.contentType(APPLICATION_JSON)
.content(objectMapper.writeValueAsString(bulkDeviceUploadRequestWithDeviceThatWeAlreadyKnow())))
.andExpect(status().isOk());
expectSingleError(secondResultActions, DEVICE_INTERNAL_ID_DUPLICATE, new Error("DEVICE.UPLOAD.ERROR.DEVICE_EXISTS", "Device already known in the system."));