Skip to content

Instantly share code, notes, and snippets.

View falsefalse's full-sized avatar

Illia Furman falsefalse

View GitHub Profile
@falsefalse
falsefalse / gist:439444
Created June 15, 2010 18:08
afair, this prints dimensions for all background images on the page
console.clear && console.clear();
var images = [];
var elements = document.querySelectorAll('#global div');
for (var i = 0, l = elements.length; i < l; i++) {
var element = elements[i];
var bgImg = document.defaultView.getComputedStyle(element, null).getPropertyValue('background-image');
if (bgImg == 'none') {
continue;
}
var match = bgImg.match(/url\((.+)\)/);
require 'hpricot'
require 'open-uri'
require 'active_support/core_ext/numeric/conversions'
@base = "http://simpledesktops.com"
def scrape_page(url, page_number = 0)
Dir.mkdir "#{page_number}" unless File.exists? "#{page_number}"
doc = Hpricot( open( url ) )
@falsefalse
falsefalse / mongrel.sh
Created March 22, 2011 21:35
manage mongrel in development enviroment
We couldn’t find that file to show.
// swap name and last name in JIRA
// that way is convenient to find people as you type
Array.prototype.forEach.call($('#assignee option[value!=-1]'), function(o) {
var t = o.innerText;
o.innerText = t.split(' ').reverse().join(' ');
});
@falsefalse
falsefalse / .git-ignoreoncommit.sh
Created September 23, 2011 21:11
Git ignore changed files on commit
# do whatever the fuck you want with it license
# set 'assume unchanged' for files in list, replicates tortoise svn 'ignore on commit' feature
# source ~/.git-ignoreoncommit.sh in your profile
# https://github.com/falsefalse
function git-ioc {
VER="0.2"
ignorefile=".gitignore-oncommit"
@falsefalse
falsefalse / .gitignore
Created November 20, 2011 00:05
Add all LaterLoop unread links to Instapaper
node_modules
@falsefalse
falsefalse / list.txt
Last active October 11, 2015 12:37
Spy movies
Spy Game, 2001
The Good Shepherd, 2006
The Ghost Writer, 2010
Ronin, 1998
The Spy Who Came in from the Cold, 1965
Tinker Tailor Soldier Spy, 2011
The American, 2010
A Most Wanted Man, 2014
@falsefalse
falsefalse / _Custom.css
Last active December 14, 2015 00:18
Chrome user stylesheets
/* Monospace font for GMail plaintext view and compose */
div[class="ii gt adP adO"],
.Ap textarea, .At textarea,
div[class*="LW-avf"] {
font-family: monospace !important;
font-size: 1em !important;
}
var Transport = function(methods) {
var fn = function(options) {
this.options = options || {};
};
_.extend(fn.prototype, Transport.prototype, methods);
return fn;
};
_.extend(Transport.prototype, Backbone.Events, {
// stub
validate: function(parsed) { return true; },
@falsefalse
falsefalse / bq10.js
Last active January 2, 2016 07:19
BQ
/*
* Do it.
*
*/
var th = this.thrusters, pod = this;
var _course;
function course(dir) {
// shutdown current engine
_course && th[ _reverse(_course) ](!!0);
// don't thrust in the direction of movement