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 | |
| // My original function | |
| function max_length($array) { | |
| $max = 0; | |
| foreach($array as $child) { | |
| if(count($child) > $max) { | |
| $max = count($child); | |
| } | |
| } | |
| return $max; |
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
| // Paste into Firebug or Chrome Dev Tools console | |
| // when viewing a page with multiple checkboxes. | |
| (function(d) { | |
| var input = d.querySelectorAll('input[type="checkbox"]'); | |
| var i = input.length; | |
| while (i--) { | |
| input[i].checked = true; | |
| } |
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 | |
| /* | |
| Took 10.474477052689 seconds | |
| Took 12.499534845352 seconds | |
| */ | |
| set_time_limit( 0 ); | |
| $searchText = 'Page and Brin originally nicknamed THEIR new search engine "BackRub", because the system checked backlinks to estimate the importance of a site.'; | |
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 extract() { | |
| filename=$1 | |
| if [ -f $filename ]; then | |
| case $filename in | |
| *.tar.xz) tar xvfJ $filename ;; | |
| *.tar.gz) tar --gzip -xvf $filename ;; | |
| *.tar.bz2) tar --bzip2 -xvf $filename ;; | |
| *.tar) tar -xvf $filename ;; | |
| *.tgz) tar --gzip -xvf $filename ;; | |
| *.tbz2) tar --bzip2 -xvf $filename ;; |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import selenium, re | |
| from selenium import webdriver | |
| from selenium.webdriver.support.wait import WebDriverWait | |
| browser = None | |
| should_log = 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
| from scrapy.linkextractors import LinkExtractor | |
| from scrapy.spiders import CrawlSpider, Rule | |
| from scrapy.item import Item, Field | |
| import logging | |
| logger = logging.getLogger() | |
| class WebItem(Item): | |
| url = Field() | |
| title = Field() |
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
| #include <iostream> | |
| #include <fstream> | |
| #include <sstream> | |
| #include <vector> | |
| #include <numeric> | |
| #include <cmath> | |
| #include <algorithm> | |
| #include <list> | |
| #include <map> | |
| #include <iterator> |
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
| #!/bin/bash | |
| vpnbook_pass=$(curl -sL vpnbook.com | grep -ioP -m1 "<li><strong>Password: \K(\S+)(?=</strong></li>)" | tr -d '\n') | |
| echo -e "vpnbook\n$vpnbook_pass" |
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
| javascript:(function()%7Bs%3Ddocument.getElementsByTagName(%27SCRIPT%27)%3Btx%3D%27%27%3Bsr%3D%5B%5D%3Bfor(i%3D0%3Bi<s.length%3Bi%2B%2B)%7Bwith(s.item(i))%7Bt%3Dtext%3Bif(t)%7Btx%2B%3Dt%3B%7Delse%7Bsr.push(src)%7D%3B%7D%7D%3Bwith(window.open())%7Bdocument.write(%27<textarea id%3D"t">%27%2B(sr.join("%5Cn"))%2B"%5Cn%5Cn-----%5Cn%5Cn"%2Btx%2B%27</textarea><script src%3D"http://jsbeautifier.org/beautify.js"></script><script>with(document.getElementById("t"))%7Bvalue%3Djs_beautify(value)%3Bwith(style)%7Bwidth%3D"99%25"%3Bheight%3D"99%25"%3BborderStyle%3D"none"%3B%7D%7D%3B</script>%27)%3Bdocument.close()%3B%7D%7D)()%3B |
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
| #!/usr/bin/env python3 | |
| import json | |
| from base64 import b64decode | |
| import requests as rq | |
| def rpc(method, data=None, post=False): | |
| headers = { |
OlderNewer