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
/* | |
* 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.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
/* | |
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
$.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
#!/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
git remote update | |
git rebase origin/master | |
# no diff | |
git tag v5.17 | |
perl Makefile.PL; make manifest; make dist | |
1) make sure master is in a good state | |
2) tag release | |
3) perl Makefile.PL; make manifest; make dist | |
4) upload release, ...optional... |
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
#!/bin/sh | |
EXPRESSION=${1:-"tcp port 22"}; | |
DEVICE="wlan0"; | |
while tcpdump -p -c 1 -i $DEVICE "$EXPRESSION"; do | |
iwconfig $DEVICE power off; | |
sleep 600; | |
iwconfig $DEVICE power on; | |
done |
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
Object.prototype.emit = function(name, d) { | |
this.dispatchEvent(new CustomEvent(name, { detail: d })); | |
return this; | |
}; | |
Object.prototype.on = function(name, cb) { | |
this.addEventListener(name, cb, false); | |
return cb; | |
}; | |
Object.prototype.once = function(name, cb) { | |
var wrapper = function() { |
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
plugin 'OAuth2', { | |
google => { | |
key => 'public app id from google', | |
secret => 'private secret from google', | |
}, | |
}; |