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 8000
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 8000
(Also see [remarkable][], the markdown parser created by the author of this cheatsheet)
#!/bin/bash | |
target_branch="production" | |
working_tree="PATH_TO_DEPLOY" | |
while read oldrev newrev refname | |
do | |
branch=$(git rev-parse --symbolic --abbrev-ref $refname) | |
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then | |
set(PRJ_NAME CLion_STM_LED) | |
set(MCU_FAMILY STM32F1xx) | |
set(MCU_LINE STM32F103xB) | |
set(MCU_LINKER_SCRIPT STM32F103RBTx_FLASH.ld) | |
cmake_minimum_required(VERSION 3.6) | |
project(${PRJ_NAME} C ASM) | |
add_definitions(-D${MCU_LINE}) |
Also see: https://gist.github.com/lemiorhan/8912188
Here are the simple steps needed to push your local git repository directly to a remote (e.g. prod) server over ssh. This is based on Digital Ocean's Tutorial.
You are developing in a working-directory on your local machine, let's say on the master
branch. Usually people push code to a remote
server like github.com or gitlab.com and pull or export it to a production server. Or you use GitHub's webhooks to send a POST request to a webserver to take appropriate actions such as cloning/checking out a branch on the remote (prod) server.
The Arduino webserver library from the ESP8266 is very simple and you can get to its limits pretty fast!
So that beeing said I first want to recommend you this library: ESPAsyncWebServer.
It's a very good alternative with a lot of features and it's easy to use.
However I wanna show you an easy way to hack around the standard webserver library for projects which can't make use of the ESPAsyncWebserver library.
So what we want to do is making the ESP8266 serve files via its webserver that are bigger than the RAM size we have left.
A picture for example. You don't want to hold that in the RAM, it's limited and way to valuable to be used for this.
javascript:(function(){ | |
var buttons = document.querySelectorAll('#menu ytd-toggle-button-renderer button.style-scope.yt-icon-button'); | |
var likes = buttons[0].attributes["aria-label"].nodeValue; | |
var dislikes = buttons[1].attributes["aria-label"].nodeValue; | |
var regex = /[\d,.]+/; | |
likes = likes.match(regex); | |
dislikes = dislikes.match(regex); | |
alert("Likes: " + likes + "\nDislikes: " + dislikes); | |
})(); |