I hereby claim:
- I am ultrabenosaurus on github.
- I am ultrabenosaurus (https://keybase.io/ultrabenosaurus) on keybase.
- I have a public key whose fingerprint is CD4A DCC2 EE8C 56D5 EAD6 2EB5 0BFA 5929 871C C7DB
To claim this, I am signing this object:
| @echo off | |
| :: ========== | |
| :: Code to automatically request UAC elevation via PowerShell if launched without admin priviledges. | |
| :: | |
| :: source: https://stackoverflow.com/a/24665214 | |
| :: license: https://creativecommons.org/licenses/by-sa/4.0/ | |
| :: changes: none | |
| :: ========== |
| #!/bin/bash | |
| ## | |
| # | |
| # MotionEye-IFTTT-Webhook.sh | |
| # A script to trigger IFTTT webhook applets from MotionEye software | |
| # | |
| # author: Ultrabenosaurus | |
| # license: BSD 3-Clause | |
| # source: https://gist.github.com/Ultrabenosaurus/5916101463f5d00732f901e7a3d8a2c2 |
| { | |
| "description": "Redirect AMP addresses to their non-AMP sources", | |
| "manifest_version": 2, | |
| "name": "AMP Redirect", | |
| "version": "0.1", | |
| "author": "Ultrabenosaurus", | |
| "_comments_": { | |
| "signed_xpi": "https://drive.google.com/file/d/1Pg19uXregtxfENnKO3tcvR2SiTu01IYf/view?usp=sharing", | |
| "source:": "https://gist.github.com/Ultrabenosaurus/b94d373f3a32d2b5d6ae5256e04784a7", |
| ##### | |
| # | |
| # Download all of the Standard eBooks catalogue from their OPDS feed. | |
| # | |
| # https://standardebooks.org/ | |
| # | |
| # Modified to download all files for each book except the SVG cover and to | |
| # organise the files in subfolders by Author > Book Title. | |
| # The original script downloads only the EPUB file for each book into the | |
| # working directory with no subfolders. |
| #!/bin/bash | |
| ############################################# | |
| # | |
| # mp4-to-gif | |
| # | |
| # Convert MP4 videos to GIF images | |
| # Requires ffmpeg and imagemagick | |
| # | |
| # -g and --gifsicle options create a second optimised GIF for your consideration |
I hereby claim:
To claim this, I am signing this object:
| <?php | |
| $colour = "#" . ( ( isset( $_GET['colour'] ) ) ? $_GET['colour'] : "000000" ); | |
| ?> | |
| <!DOCTYPE html> | |
| <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
| <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
| <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
| <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> | |
| <head> |
| # tree | |
| # list the directory structure with the current location as the top level | |
| # based on https://gist.github.com/gpupo/c546128385493c71246d | |
| tree() { | |
| if [ ! $# -eq 0 ]; then | |
| case $1 in | |
| -a) ls -aR | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/';; | |
| -at) ls -a | grep "/$" | sed -e 's~/$~~' -e 's/^/--/g' -e 's/^/ /' -e 's/-/|/';; | |
| -t) ls | grep "/$" | sed -e 's~/$~~' -e 's/^/--/g' -e 's/^/ /' -e 's/-/|/';; | |
| *) ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/';; |
| // Your code here. | |
| function every(array,predicate){ | |
| for(var i = 0; i<array.length; i++){ | |
| if (!predicate(array[i])) | |
| return false; | |
| } | |
| return true; | |
| } | |
| function some(array,predicate){ |
So you need to grab some pretty complex HTML - likely a whole page - via AJAX and extract a certain portion of it for use.
You're already using jQuery for your project, or it's not a big deal to add, so you figure it's super-simple and powerful selector functions like find will make your life a whole lot easier.
I mean, you can just pass HTML into the top-level $() function and it'll turn into a jQuery DOM representation so you can just chain a find call onto that, right? Wrong.
Mostly due to the underlying browser APIs that jQuery has to rely on, complex HTML and especially entire pages get filtered into a big mess that makes using regex on the raw text response about as easy as using jQuery for it.