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 mitmproxy import http | |
| from pathlib import Path | |
| from urllib.parse import urlparse | |
| import hashlib | |
| import re | |
| OUTPUT_DIR = Path.home() / "Descargas" / "segments" | |
| OUTPUT_DIR.mkdir(parents=True, exist_ok=True) | |
| seen = set() |
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
| $ more /usr/local/bin/video2gif.sh | |
| #!/bin/bash | |
| # https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/ | |
| echo "Video file: " | |
| read video_file | |
| echo "Video start position (HH:MM:SS): " | |
| read start_seek |
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 | |
| // https://stackoverflow.com/a/13101631 | |
| $colorFormats = array( | |
| // styles | |
| // italic and blink may not work depending of your terminal | |
| 'bold' => "\033[1m%s\033[0m", | |
| 'dark' => "\033[2m%s\033[0m", | |
| 'italic' => "\033[3m%s\033[0m", |
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 | |
| for ( $i = 0; $i<10; $i++) { | |
| $width = rand(600, 1200); | |
| $height = rand(600, 1200); | |
| file_put_contents( uniqid(rand(), true) . '.jpg', file_get_contents( 'https://picsum.photos/'.$width.'/'.$height)); | |
| sleep(2); | |
| } |
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
| for i in $(git status -s | sed 's/^\s//' | cut -d " " -f2 | grep '.php'); do ./vendor/bin/phpcs "$i"; done |
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
| // | |
| const regex = /[\w_-]+=(['"])((?!\1).)+\1/gu; | |
| `<div data-slogan="Don't do it" data-warning='Use double quotes (")'>`.match( regex) |
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
| grep 'error_log\|console' $(git status -s | sed 's/^\s//' | cut -d " " -f2) |
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 elem = document.getElementById('myid'); | |
| var w = window.getComputedStyle(elem).width; |
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 parent = document.getElementById('myid').parentNode |
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
| // Not valid for IE8 or older (I don't mind) | |
| document.addEventListener("DOMContentLoaded", () => { | |
| // Some code | |
| }); |
NewerOlder