Skip to content

Instantly share code, notes, and snippets.

View amytych's full-sized avatar

Arek Mytych amytych

  • Datastory
  • Stockholm
View GitHub Profile
@amytych
amytych / Spotify Track Info
Last active August 29, 2015 14:11
Display name and artist for the current Spotify track
on run {input, parameters}
tell application "Spotify"
set t_artist to artist of current track
set t_name to name of current track
end tell
display notification t_name & " by " & t_artist
return input
end run
// Sometimes activity stream is so long
// it's not possible to keep up with it
// and everyone deserves a prop for their effort
var propCounter = 0;
var interval = setInterval(function() {
var $propers = $('.give_prop'), $proper;
if ($propers.length) {
$proper = $propers.first();
console.log($proper.parents('.stream_item').find('.stream-author').text());
@amytych
amytych / gist:4085779
Created November 16, 2012 09:16
Calculate shifted area of google map
/**
* Calculate bounds for the whole map or just the shifted area
* @param {Boolean} reset Force calculation for the whole map
* @return {Array} Array of map bounds arrays
*/
function calculateNewBounds(reset) {
var curSW = currentBounds.getSouthWest(),
curNE = currentBounds.getNorthEast(),
curNW = new google.maps.LatLng(curNE.lat(), curSW.lng()),
@amytych
amytych / common.less
Created May 10, 2012 06:26
Useful LESS mixins
//MIXINS
.borderRadius (@radius: 5px) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}
.gradientImage (@fallback, @stop1, @stop2) {
background-color: @fallback;
background-image: -webkit-linear-gradient(top, @stop1, @stop2);