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
| /* | |
| Take a look at the console http://jsbin.com/onipeq/ | |
| */ | |
| $("input").live("click",function(){ | |
| label = findLabel($(this)); | |
| console.log(label); | |
| }); | |
| function findLabel(/* jQuery Element */ el){ |
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
| var f = $("#form"); | |
| // attempt 1: average abbout 2.621 seconds | |
| (function(){ | |
| i = 0; | |
| j = 0; | |
| start = new Date().getTime(); | |
| for(j = 0; j < 1000; j++){ | |
| f.find(':visible').find("input,select,textarea,button").not("[type=hidden],[type=submit]").map(function() { return { order: i++, name: $(this).attr("name") }; } ); | |
| } |
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
| // run in webkit console | |
| $("script").filter(function(){ | |
| return ($(this).attr("src") || "").indexOf("alias") !== -1; | |
| }).map(function(){ | |
| return $(this).attr("src").split("alias=")[1].split(";")[0]; | |
| }); | |
| // jquery safe mode |
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
| <!DOCTYPE html> | |
| <!--[if lt IE 7]> <html dir="ltr" lang="en-US" class="lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
| <!--[if IE 7]> <html dir="ltr" lang="en-US" class="lt-ie9 lt-ie8"> <![endif]--> | |
| <!--[if IE 8]> <html dir="ltr" lang="en-US" class="lt-ie9"> <![endif]--> | |
| <!--[if gt IE 8]><!--> <html dir="ltr" lang="en-US"> <!--<![endif]--> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta content='width=device-width, initial-scale=1, maximum-scale=1' name='viewport' /> | |
| <meta http-equiv="X-UA-Compatible" content="IE=Edge"/> | |
| <meta content='yes' name='apple-mobile-web-app-capable' /> |
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
| # swap out 'videoid' for whichever meta keys you want | |
| SELECT A.ID, B.post_id, A.post_title, A.post_date FROM | |
| (SELECT ID, | |
| post_date, post_title | |
| FROM wp_posts | |
| WHERE post_status = "publish" | |
| ) as A |
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
| props = Object.getOwnPropertyNames(window); for(prop in props) { if(props[prop].toLowerCase().toString().indexOf("adtech") != - 1){ console.log(props[prop]); } } |
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
| # array of arrays | |
| a = [[10, 1000], [9, 923], [8, 1230], [7, 10]] # [data,frequency] | |
| mean = a.reduce(0) { |m,r| m += r[0] * r[1] } / a.reduce(0) { |m,r| m += r[1] }.to_f |
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
| <?php | |
| class WP_Customize_Category_Control extends WP_Customize_Control { | |
| public $type = 'dropdown-category'; | |
| public function render_content() { | |
| $dropdown = wp_dropdown_categories(array( | |
| "selected" => $this->value(), | |
| "name" => $this->settings["default"]->id, | |
| "echo" => 0 | |
| )); |
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
| # name: rick | |
| # description: The best bolt | |
| # keyword: rick | |
| result(title:"rick", description:"No strangers to love", action: actions.open("http://www.youtube.com/watch?gl=GB&hl=en-GB&v=oHg5SJYRHA0")) |
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
| window.confirm = function() { | |
| console.log.apply(console, arguments); return true; | |
| }; | |
| $(".host_status[data-traffic_light_level=3], .host_status[data-traffic_light_level=4]").each(function(i,el){ | |
| var p = $(this).parent(); | |
| var del = $(p).find(".delete_link.to_spinner"); | |
| var no_data = $(p).find(".no_data").length > 0; | |
| if(no_data && del.length > 0){ | |
| setTimeout(function() { | |
| console.log($(p).find(".app_name").text()); |
OlderNewer