Skip to content

Instantly share code, notes, and snippets.

@ajitam
ajitam / qfind.sh
Created March 16, 2011 09:14
Bash script to find files
qfind () {
PS3="Which one: "
select opt in $(find /Users/matija/ -name "$1*" -type f) quit
do
if [[ $opt = "quit" ]]
then
break
fi
@ajitam
ajitam / removeGoogleAdds.css
Created March 16, 2011 09:17
Small css file to remove Google adds in Mailplane
table.Bs.nH.iY tr td div div div div.u5,
table.Bs.nH.iY tr td div div div span.u7 {display: none !important;}
@ajitam
ajitam / SVNstat.sh
Created March 16, 2011 09:21
Bash script to show you daily commits
#!/bin/bash
#Go to a folder
cd /home/matija/portal
echo Your SVN logs for $3.$2.$1
echo
echo --------------- Portal -----------------
/usr/bin/svn log -r '{'$1'-'$2'-'$3'}:{'$1'-'$2'-'$(($3+1))'}' | sed -n '/matija/ {; n; ; n; p;}';
echo
@ajitam
ajitam / gmail-font.css
Created May 14, 2011 09:29
Change font in Gmail
body,
td,
input,
textarea,
select,
.nJ,
.J-Zh-I,
.VP5otc-tOAp0c,
.VP5otc-ynQFL {font-family: Ubuntu, arial, sans-serif !important;}
@ajitam
ajitam / gist:1108038
Created July 26, 2011 21:05
"Downgrade" Lion's AFP protokol (so that he can connect to WD disks)
# Launch /Applications/Utilities/Terminal and do:
sudo chmod o+w /Library/Preferences
defaults write /Library/Preferences/com.apple.AppleShareClient afp_host_prefs_version -int 1
# Restart your computer.
# From Finder, select an AFP server, or use "Connect To...".
# This will cause the AFP Client to create the full preferences file
# Launch Terminal again and do:
@ajitam
ajitam / html5.html
Created July 28, 2011 09:00
html5 structure
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>...</title>
</head>
<body>
<!-- Header -->
<header>...</header>
@ajitam
ajitam / widget_weather.php
Created April 21, 2012 19:13
Get weather from ARSO
<?php
date_default_timezone_set('Europe/Belgrade');
function align($string, $width) {
$spaces = 0;
$spaces = $width - strlen($string);
for($i = 0; $i < $spaces; $i++) {
$result .= " ";
}
@ajitam
ajitam / Torrentleach filter
Last active December 17, 2015 15:19
Torrentleech - movies downloded times... (Minimalist - Chrome extension)
var times,
opacity;
$("#torrenttable tbody tr").each(function() {
times = $(this).find('td').eq(5).text();
//console.log(parseInt(times.replace("times", ""),10));
opacity = (parseInt(times.replace("times", ""),10))*0.000225;
$(this).css('background-color', 'rgba(255,0,0,'+opacity+')');
});
var max_height = 0;
$(".resize-height li").removeAttr('style');
$(".resize-height li").each(function() {
if($(this).outerHeight() > max_height) {max_height = $(this).outerHeight();}
});
$(".resize-height li").css('min-height', max_height+5+'px');
@ajitam
ajitam / locator.js
Last active December 18, 2015 08:39
Get user location. Is there a better way?
// http://jsfiddle.net/2vbY8/1/
var locator = {
current_location: null,
getLocation: function() {
if (navigator.geolocation) {
// Browser DOES support HTML location
navigator.geolocation.getCurrentPosition(locator.locationOK,locator.locationFAIL);
} else {