Check if device is connected and running
./adb devices
Pull files from device to directory
./adb pull "/sdcard/<filename or dir>" "<destination dir>"
Push files to device
| // This script downloads all images one after another from a webpage that match a specific CSS selector. | |
| // Requires images to be downloadable through the browser (CORS policy must allow it). | |
| // You can run this code in the browser console. | |
| const downloadAllImages = async (pattern) => { | |
| const images = document.querySelectorAll(pattern); | |
| const imageUrls = Array.from(images).map(img => img.src); | |
| const imagePromises = imageUrls.map(url => fetch(url).then(res => res.blob())); | |
| const imageBlobs = await Promise.all(imagePromises); | |
| const imageDataUrls = await Promise.all(imageBlobs.map(blob => URL.createObjectURL(blob))); |
| <?php | |
| /** | |
| * Add oEmbed support to ACF WYSIWYG fields. | |
| * | |
| * Fixes issue with WP-native oEmbeds not working in ACF WYSIWYG fields because | |
| * these fields are saved in the database without post IDs. WP's oEmbed works out | |
| * of the box only with direct post content. | |
| */ |
| -- SELECT | |
| WITH recursive custom_cte AS | |
| ( SELECT | |
| * | |
| FROM | |
| target_table | |
| WHERE | |
| target_table.id = "value" | |
| # See https://h2o.examp1e.net/install.html for more info. | |
| # Update apt-get library | |
| sudo apt-get update | |
| # Install cmake | |
| sudo apt-get install cmake | |
| # Install build tools (CXX compiler) | |
| sudo apt-get install build-essential |
Check if device is connected and running
./adb devices
Pull files from device to directory
./adb pull "/sdcard/<filename or dir>" "<destination dir>"
Push files to device
| // Easy immediately invoked function expression (IIFE) to find the current scrollbar width in browser | |
| // Returns a number of scrollbar width in pixels | |
| const scrollBarWidth = (() => { | |
| const a = document.createElement('div'); | |
| document.body.appendChild(a).style.overflowY = 'scroll'; | |
| const w = a.offsetWidth - a.clientWidth; | |
| a.remove(); | |
| return w; | |
| })(); |
| @function encode-uri($uri) { | |
| $enc: str-replace($uri, '"', "'"); | |
| $enc: str-replace($enc, '<', '%3C'); | |
| $enc: str-replace($enc, '>', '%3E'); | |
| $enc: str-replace($enc, '&', '%26'); | |
| $enc: str-replace($enc, '#', '%23'); | |
| @return $enc; | |
| } |
| Windows Registry Editor Version 5.00 | |
| [HKEY_CURRENT_USER\SOFTWARE\Classes\.bmp] | |
| @="PhotoViewer.FileAssoc.Tiff" | |
| [HKEY_CURRENT_USER\SOFTWARE\Classes\.gif] | |
| @="PhotoViewer.FileAssoc.Tiff" | |
| [HKEY_CURRENT_USER\SOFTWARE\Classes\.ico] |
ssh -fNL 3306:localhost:3306 [email protected]
| node-sass -w main.scss main.css --output-style compressed | |
| node-sass -w scss/ -o css/ --output-style compressed |