Skip to content

Instantly share code, notes, and snippets.

@abernier
abernier / detachvideo.js
Last active August 29, 2015 13:57
Detach video bookmarklet: javascript:(function (src) {var s;s=document.createElement('script');s.src=src;document.body.appendChild(s);}('https://gist.githubusercontent.com/abernier/9730666/raw/detachvideo.js'));)
(function () {
function findBiggestVideo(window) {
return [].slice.call(window.document.querySelectorAll('video,object,iframe')).sort(function (elA, elB) {
var aDims = elA.getBoundingClientRect();
var bDims = elB.getBoundingClientRect();
return aDims.width*aDims.height < bDims.width*bDims.height;
})[0];
}
(function(t,e){if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,r,s){t.Backbone=e(t,s,i,r)})}else if(typeof exports!=="undefined"){var i=require("underscore");e(t,exports,i)}else{t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}})(this,function(t,e,i,r){var s=t.Backbone;var n=[];var a=n.push;var o=n.slice;var h=n.splice;e.VERSION="1.1.2";e.$=r;e.noConflict=function(){t.Backbone=s;return this};e.emulateHTTP=false;e.emulateJSON=false;var u=e.Events={on:function(t,e,i){if(!c(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,r){if(!c(this,"once",t,[e,r])||!e)return this;var s=this;var n=i.once(function(){s.off(t,n);e.apply(this,arguments)});n._callback=e;return this.on(t,n,r)},off:function(t,e,r){var s,n,a,o,h,u,l,f;if(!this._events||!c(this,"off",t,[e,r]))return this;if(!t&&!e&&!r){this._events=void 0;return this}o=t?[t]:i.keys(
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,initial-scale=1,user-scalable=no">
<style>
html {-webkit-perspective:250;}
body {width:100%; height:100%; position:relative;}
body, body * {-webkit-transform-style:preserve-3d;}
@abernier
abernier / lol.txt
Last active August 29, 2015 14:12
hangout /konamicons
hahahaha
hehehehe
ROFL
lmao
Yay!!
woohoo
Happy Birthday
@abernier
abernier / README.md
Created February 5, 2015 13:58
$.fn.domvertices

$.fn.domvertices

@abernier
abernier / README.md
Last active August 29, 2015 14:17
inherit.js

Classical inheritance for constructors.

INSTALL

Client-side

<script src="inherit.js"></script>
@abernier
abernier / README.md
Last active August 29, 2015 14:17
watchcss

Watch a DOM element for [style] css properties changes.

It uses MutationObserver internally

Synopsis

new Watchcss(el, ['propA', 'propB', ...])
  .observe()
  .disconnect()
rect {fill:url(#Gradient-1);}
$ ruby
puts "Hello, World!"
^D
Hello, World!
$ ruby -e 'puts "Hello, World!"'
Hello, World!
$ irb
>> puts "Hello, World!"
require 'rubygems'
require 'nokogiri'
require 'open-uri'
Nokogiri::HTML(open('http://www.google.com/search?q=tenderlove')).xpath('//h3/a[@class="l"]').each do |link|
puts link.content
end