Skip to content

Instantly share code, notes, and snippets.

View MaciekBaron's full-sized avatar
Recruiters, please DON'T contact me

Maciek Baron MaciekBaron

Recruiters, please DON'T contact me
View GitHub Profile
@MaciekBaron
MaciekBaron / whendidifinish.sh
Last active December 15, 2015 05:09
Shows you when did you finish work (i.e. shutdown your computer) in the past
echo "last | grep shutdown | grep -v $USER" | sh | awk '{print "On "$3", "$4" "$5" finished at "$6}'
@MaciekBaron
MaciekBaron / gitcommitmsg.sh
Last active December 15, 2015 04:59
Shell command to get a list of your recent commit messages from GitHub
echo Enter username; read i; echo "curl https://api.github.com/users/$i/events -s" | sh | grep message | sed -e 's/ "message": //g' -e 's/",/"/g'
@MaciekBaron
MaciekBaron / SimpleDebug.js
Last active December 15, 2015 03:48
A very simple debug "thing" for JavaScript. You can debug messages by calling SimpleDebug.debug("My message", "some group", "log"), which will appear in the console as: [some group] My message. You can enable/disable debug, only display messages assigned to a certain group (setDebugGroup) etc.. Enjoy.
/*
* Author: Maciej Baron
*/
;(function (SimpleDebug, $, undefined) {
/*
* Simple debugging
*/
var debugEnabled = false;
@MaciekBaron
MaciekBaron / jsmodule.sublime-snippet
Last active October 11, 2015 15:27
Sublime snippet for creating JavaScript "modules" using anonymous self-executing functions
<!--
Just simply type 'module', press Tab, then enter the name of the "module",
press Tab again and then either press Backspace to remove JQuery "support"
or press Tab once more to finish.
This creates an anonymous self-executing function which is a design pattern
that can be seen in e.g. jQuery's source code.
One of the major benefits of this pattern is that you can limit access to
variables and functions within your closure, essentially making them private