- From: http://www.ted.com/talks/james_b_glattfelder_who_controls_the_world.html
- Through: http://gisted.in/
This file contains hidden or 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() { | |
| $.ajaxSetup({ | |
| error: function(jqXHR, exception) { | |
| if (jqXHR.status === 0) { | |
| alert('Not connect.\n Verify Network.'); | |
| } else if (jqXHR.status == 404) { | |
| alert('Requested page not found. [404]'); | |
| } else if (jqXHR.status == 500) { | |
| alert('Internal Server Error [500].'); | |
| } else if (exception === 'parsererror') { |
This file contains hidden or 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
| BEGIN TRANSACTION; | |
| CREATE TEMPORARY TABLE test_temp(a integer,b integer,c integer); | |
| INSERT INTO test_temp SELECT * FROM test; | |
| DROP TABLE test; | |
| CREATE TABLE test (a integer,b integer,c integer,d integer); | |
| INSERT INTO test SELECT *,null FROM test_temp; | |
| DROP TABLE test_temp; | |
| COMMIT; |
This file contains hidden or 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
| port -u uninstall | |
| port clean --all installed |
This file contains hidden or 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
| //input type, id, name, all inputs | |
| $('input #inputid').attr("disabled", "disabled"); |
This file contains hidden or 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
| jQuery('a.popup').live('click', function(){ | |
| newwindow=window.open($(this).attr('href'),'','height=200,width=150'); | |
| if (window.focus) {newwindow.focus()} | |
| return false; | |
| }); |
This file contains hidden or 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 rPosition(elementID, mouseX, mouseY) { | |
| var offset = $('#'+elementID).offset(); | |
| var x = mouseX - offset.left; | |
| var y = mouseY - offset.top; | |
| return {'x': x, 'y': y}; | |
| } |
This file contains hidden or 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
| setInterval(function() { | |
| $("#refresh").load(location.href+" #refresh>*",""); | |
| }, 10000); // seconds to wait, miliseconds |
This file contains hidden or 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.egrep = function(pat) { | |
| var out = []; | |
| var textNodes = function(n) { | |
| if (n.nodeType == Node.TEXT_NODE) { | |
| var t = typeof pat == 'string' ? | |
| n.nodeValue.indexOf(pat) != -1 : | |
| pat.test(n.nodeValue); | |
| if (t) { | |
| out.push(n.parentNode); | |
| } |
This file contains hidden or 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
| #footer { | |
| position:fixed; | |
| left:0px; | |
| bottom:0px; | |
| height:30px; | |
| width:100%; | |
| background:#999; | |
| } | |
| /* IE 6 */ | |
| * html #footer { |
NewerOlder