Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| <?php | |
| /** | |
| * | |
| * @param string $tag_value | |
| * @param int $user_id mailpoet's subscriber id | |
| * @return type | |
| */ | |
| function mailpoet_shortcodes_custom_filter( $tag_value , $user_id ) { | |
| /** | |
| * Returns the total amount of disk space used (in MB) by localStorage for the current domain. | |
| */ | |
| var getLocalStorageSize = function() { | |
| var total = 0; | |
| for (var x in localStorage) { | |
| // Value is multiplied by 2 due to data being stored in `utf-16` format, which requires twice the space. | |
| var amount = (localStorage[x].length * 2) / 1024 / 1024; | |
| total += amount; | |
| } |
| <?php | |
| /* | |
| * Set the following constants in wp-config.php. | |
| * These should be added somewhere BEFORE the constant ABSPATH is defined. | |
| * | |
| * Author: Chad Butler | |
| * Author URI: https://butlerblog.com | |
| * | |
| * For more information and instructions, see: https://b.utler.co/Y3 |
It sometimes happen you need change code on a machine from which you cannot push to the repo.
You’re ready to copy/paste what diff outputs to your local working copy.
You think there must be a better way to proceed and you’re right. It’s a simple 2 steps process:
1. Generate the patch:
git diff > some-changes.patch| package main | |
| import ( | |
| "fmt" | |
| "sync" | |
| ) | |
| type Crawler struct { | |
| crawled map[string]bool | |
| mux sync.Mutex |
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
| // ==UserScript== | |
| // @name YoutubeLite | |
| // @namespace com.vsubhash.js.YoutubeLite | |
| // @description Loads a lite version of Youtube, adds video file downloads and subtitle links | |
| // @include https://www.youtube.com/watch* | |
| // @version 2020.07.07 | |
| // @grant none | |
| // ==/UserScript== | |