This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
package No::Headers; | |
use Mojo::Base "Mojo::Headers"; | |
sub to_string { "" }; | |
package main; | |
use Mojolicious::Lite; | |
get "/" => sub { | |
my $c = shift; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.passThrough = function() { | |
this.hover( | |
function() { $(this).fadeTo('fast', 0.2); }, | |
function() { $(this).fadeTo('fast', 1.0); } | |
); | |
this.each(function() { | |
var self = this; | |
var last; | |
$(self).bind('click mousemove mouseout', function (e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
add inline styling (<tag style="...">) from calculated css. | |
1. Paste the code below into the javascript console | |
2. Go back to the "Elements" view, where all the selected element and all sub elements has inline styling | |
*/ | |
// add to whole document | |
$('body, body *').each(function(){var $e=$(this);$e.attr('style',$.map(["opacity","filter","azimuth","background","background-attachment","background-color","background-image","background-position","background-repeat","border","border-collapse","border-color","border-spacing","border-style","border-top","border-right","border-bottom","border-left","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-width","border-right-width","border-bottom-width","border-left-width","border-width","bottom","caption-side","clear","clip","color","content","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","elevati |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$.fn.disableOuterScroll = function() { | |
return this.bind('mousewheel DOMMouseScroll', function(e) { | |
var scrollTo = null; | |
if(e.type == 'mousewheel') { | |
scrollTo = (e.originalEvent.wheelDelta * -1); | |
} | |
else if(e.type == 'DOMMouseScroll') { | |
scrollTo = 40 * e.originalEvent.detail; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* queue.js allow you to run async callbacks in serial. | |
*/ | |
var Queue = { | |
callbacks: [], | |
idle: true, | |
// Queue.add(function() {}); | |
// Used to add a new function to the callback queue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$.fn.fixedHeader = function() { | |
this.each(function() { | |
var $table = $(this); | |
var $dummy = $('<table><tr></tr></table>'); | |
var $th = $table.find('thead:first tr:first th').clone(); | |
var $td = $table.find('tbody:first tr:first td'); | |
var place = function() { | |
$dummy.css({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
my $connections = {}; | |
my $drawings = {}; | |
# demo here: http://whiteboard-jhthorsen.dotcloud.com/ | |
get '/' => sub { | |
my $self = shift; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
qw/ | |
abs accept alarm atan2 bind binmode bless break caller chdir | |
chmod chomp chop chown chr chroot close closedir connect | |
continue cos crypt dbmclose dbmopen default defined delete die | |
do dump each endgrent endhostent endnetent endprotoent endpwent | |
endservent eof eval exec exists exit exp fcntl fileno flock fork | |
format formline getc getgrent getgrgid getgrnam gethostbyaddr | |
gethostbyname gethostent getlogin getnetbyaddr getnetbyname | |
getnetent getpeername getpgrp getppid getpriority getprotobyname |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Foo { | |
our $bar = 123; | |
sub bar { 'hello' } | |
warn join ', ', keys %{ "Foo::" }; # bar | |
my $gv = ${ "Foo::" }{bar}; | |
my $scalar = *$gv{SCALAR}; | |
my $code = *$gv{CODE}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Version=1.0 | |
Name=DC50 Nokia import | |
GenericName=Photo Manager for Nokia DC50 | |
Comment=Import your photos from Nokia DC50 | |
Exec=/usr/local/bin/shotwell-mounter %U | |
Icon=shotwell | |
Terminal=false | |
Type=Application | |
MimeType=x-content/image-dcf; |