Skip to content

Instantly share code, notes, and snippets.

@vlevit
vlevit / mnuc
Last active February 19, 2023 06:37
Script intended to be executed from ncmpcpp (execute_on_song_change preference) running from urxvt to set album cover as background image
#!/bin/bash
# Script intended to be executed from ncmpcpp (execute_on_song_change
# preference) running from urxvt to set album cover as background image
# Copyright (c) 2013 Vyacheslav Levit
# Licensed under The MIT License: http://opensource.org/licenses/MIT
MUSIC_DIR=$HOME/Music
DARKEN=50 # 0 - original image colors, 100 - absolutely black background
@tylermenezes
tylermenezes / remove-rdio-garbage.js
Created December 9, 2012 10:01
Removes unavailable and preview albums from rdio. This is particularly useful after using the "Sync" feature, since it's useless and generates hundreds of "Unavailable" albums. Scroll to the bottom of your collection first, since it's lazy loaded.
(function(){
var i = 0;
var count = $('.Album.unavailable,.Album.preview').length;
console.log('Found ' + count + ' albums to remove');
var timeout = 0;
$('.Album.unavailable,.Album.preview').each(function(){
var instance_i = i++;
var album = $(this);
album.trigger('mouseover').mouseenter();
album.find('a,div,span,image').trigger('mouseover').mouseenter();
@psd
psd / index.html
Created June 13, 2012 10:09
iframe thumbnail
<!doctype html>
<html>
<head>
<title>page thumbnails using iframes and CSS3</title>
<meta charset="utf-8">
<style>
.thumbnail {
width: 300px;
height: 160px;
}
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@conorbuck
conorbuck / angle-between-points.js
Created May 5, 2012 22:51
JavaScript: Find the angle between two points
var p1 = {
x: 20,
y: 20
};
var p2 = {
x: 40,
y: 40
};
@rnmp
rnmp / ie-fallback.haml
Created August 2, 2011 01:12
Haml fallback for IE.
/[if IE]
:javascript
document.body.className += ' ie';
/[if IE 6]
:javascript
document.body.className += ' ie6';
/[if IE 7]
:javascript
document.body.className += ' ie7';
/[if IE 8]
function ip {
port=$1
if [[ port -eq '' ]]; then
echo \"http://$IP/\" copied to clipboard.
echo http://$IP/ | pbcopy
else
echo \"http://$IP:$port/\" copied to clipboard.
echo http://$IP:$port/ | pbcopy
fi
}
@rnmp
rnmp / gist:1115618
Created July 30, 2011 15:08
Sublime Text build system for SASS.
{
"cmd": ["sass", "$file_name", "$file_base_name.css"],
"working_dir": "$file_path",
"selector": "source.sass"
}
@rnmp
rnmp / README.md
Created July 4, 2011 17:52
Divit

Divit

A tiny grid-system designed to fit on almost any width of your container by providing percentage-based proportions.

@rnmp
rnmp / gist:1002209
Created June 1, 2011 12:37
Zoom in CSS3 animation
@-webkit-keyframes roll-action {
0% {
-webkit-transform: scale(2);
opacity: 0; }
100% {
-webkit-transform: scale(1);
opacity: 1; } }
span.roll-result {
-webkit-animation: roll-action 0.25s; }