jq is useful to slice, filter, map and transform structured json data.
brew install jq
| SELECT | |
| tmp.ipAddress, | |
| -- Calculate how many connections are being held by this IP address. | |
| COUNT( * ) AS numConnections, | |
| -- For each connection, the TIME column represent how many SECONDS it has been in | |
| -- its current state. Running some aggregates will give us a fuzzy picture of what | |
| -- the connections from this IP address is doing. | |
| FLOOR( AVG( tmp.time ) ) AS timeAVG, |
| addEventListener('fetch', event => { | |
| event.respondWith(handleRequest(event.request)) | |
| }) | |
| // Following code is a modified version of that found at https://blog.cloudflare.com/dronedeploy-and-cloudflare-workers/ | |
| /** | |
| * Fetch and log a request | |
| * @param {Request} request | |
| */ |
| global | |
| log 127.0.0.1 local0 | |
| maxconn 8192 | |
| user haproxy | |
| group haproxy | |
| defaults | |
| log global | |
| mode http | |
| option httplog |
| const bus = {}; | |
| const get = e => (bus[e] = bus[e] || new Set()); | |
| export const listeners = new Proxy(bus, { get }); | |
| export const emit = (e, ...args) => listeners[e].forEach(fn => fn(...args)); |
| gifify() { | |
| if [[ -n "$1" ]]; then | |
| if [[ $2 == '--good' ]]; then | |
| ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
| time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
| rm out-static*.png | |
| else | |
| ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
| fi | |
| else |
| (function() { | |
| var CSSCriticalPath = function(w, d, opts) { | |
| var opt = opts || {}; | |
| var css = {}; | |
| var pushCSS = function(r) { | |
| if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
| var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
| for(var i = 0; i < styles.length; i++) { | |
| if(!!styles[i] === false) continue; | |
| var pair = styles[i].split(": "); |
| <?php | |
| //işin sırrı headerdaki X-Requested-With: XMLHttpRequest de :) | |
| class bcurl { | |
| private $curl; | |
| private $debug = false; | |
| private $normalizeUtf = true; | |
| public $cookieFile = 'cookie.txt'; | |
| public $user_agent = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061015 Firefox/3.0'; | |
| public $gzip = "Accept-Encoding: gzip,deflate"; |