Skip to content

Instantly share code, notes, and snippets.

View fimdomeio's full-sized avatar

Alexandre fimdomeio

View GitHub Profile
@fimdomeio
fimdomeio / gist:fcc54fc1a3174d4b65365e4c61a10bb8
Created August 8, 2017 23:28 — forked from guilherme/gist:9604324
Git pre-commit hook that detects if the developer forget to remove all the javascript console.log before commit.
#!/bin/sh
#To install: add to .git/hooks/pre-commit file
# Redirect output to stderr.
exec 1>&2
# enable user input
exec < /dev/tty
regexp='^\+.*console\.log('
# CHECK
@fimdomeio
fimdomeio / axidraw-manual-control.js
Created December 10, 2016 16:34
Manual control axidraw to help with registration
/*
This requires nodejs to run
install
npm install terminal-kit
npm install superagent
run
node axidraw-manual-control.js
Keys
@fimdomeio
fimdomeio / spacing.less
Created December 8, 2016 12:31
Auto Margins and Paddings
@mm: 15px;
@lm: 30px;
@xlm: @mm*5;
.mmt {
margin-top: @mm !important;
}
.mmr {
margin-right: @mm !important;
@fimdomeio
fimdomeio / gist:e818d1819fa6ba1efd34
Created April 7, 2015 14:59
Upload Latest Mac Screenshot
#!/bin/bash
cd /Users/YOURUSER/Desktop
#get latest screenshot (change Captura de ecr to whatever your mac prefixes your screenshot filenames)
file=$(ls | grep "Captura de ecr" | tail -n1)
now=$(date +%s)
#copy to your server on a web accessible address
scp "$file" YOURSERVER:/SOME/WEB/ACCESSIBLE/ADDRESS/$now.png
#output link for sharing
echo "url: http://YOURSERVER/THE/PATH/$now.png"
@fimdomeio
fimdomeio / gist:937b59f3c04a7a2eb0c3
Created December 30, 2014 16:34
be warned via xmpp every time a user logs in you linux machine
#you'll need xsend.py script from http://xmpppy.sourceforge.net/examples/xsend.py . it's easy enough to get the dependencies
#/etc/pam.d/sshd
session optional pam_exec.so seteuid /home/YOURUSER/sshlogincmd.sh
#~/sshlogincmd.sh
#!/bin/bash
if [ $PAM_TYPE = "open_session" ]; then
/usr/bin/python /home/YOURUSER/xsend/xsend.py youxmmpuser@example.com user $PAM_USER \($PAM_RHOST\) $PAM_TYPE logged in on $HOSTNAME &
@fimdomeio
fimdomeio / showImageSizes
Last active August 29, 2015 14:12
Quick hack to show current image dimentions
$(window).on('load', function() {
var el = 'img';
getElSizes(el);
$(window).on('resize orientationChanged', function() {
$('.elSize').remove();
getElSizes(el);
});
});
var getElSizes = function(el){