Useful examples
$ echo "/home/stm32/ws/Core/main.c" | sed -e 's/^\/home\/stm32\/ws\///'
Core/main.c
<div class="h-6 w-6 animate-spin rounded-full border-[5px] border-gray-300 border-t-blue-600"></div> |
name: CI | |
on: [push] | |
jobs: | |
deploy: | |
if: github.ref == 'refs/heads/master' | |
runs-on: [ubuntu-latest] | |
steps: | |
- name: Push to server |
#<type>[optional scope]: <description> + 1 Empty line | |
#[optional body] | |
#[optional BREAKING CHANGE]: <description> | |
#[optional footer] [Ticket IDs] | |
# Type: |
docker run --rm -v $(pwd):/home/node/app -v /home/node/app/node_modules node:latest bash -c "npm start" |
/** | |
* @brief swaps a 32 bits value unsigned | |
* @param val value to swap | |
* @return Unsigned swapped value | |
*/ | |
function swap32(val) { | |
let swapped = | |
((val & 0xff) << 24) | |
| ((val & 0xff00) << 8) | |
| ((val >> 8) & 0xff00) |
// Properly delimiter words similar to bash (https://github.com/microsoft/terminal/issues/3196) | |
"wordDelimiters" : " ()\"':,;<>~!@#$%^&*|+=[]{}~?│", | |
"profiles": | |
{ | |
"defaults": | |
{ | |
"fontFace": "MesloLGLDZ Nerd Font Mono", | |
"fontSize": 9, | |
"fontWeight": "medium" |
# Use GIT_HASH define to get the git hash in your code like this: | |
# const int8_t kGitHash[] = GIT_HASH; | |
macro(stampGitHash) | |
set (git_cmd "git") | |
set (git_arg "rev-parse") | |
set (git_arg2 "HEAD") | |
execute_process(COMMAND ${git_cmd} ${git_arg} ${git_arg2} | |
RESULT_VARIABLE git_result | |
OUTPUT_VARIABLE git_hash) | |
SET(git_hash "\"${git_hash}\"") |
/* Retrieves Wordpress post data of the post number idx from a domain. | |
* Note: idx is the index of the response array of posts. | |
*/ | |
async function fetchWpPost(domain, idx) { | |
try { | |
var ret = {}; | |
const response = await fetch('https://'+domain+'/wp-json/wp/v2/posts') | |
.then(response => response.json()) | |
.then(data => { | |
ret.title = data[idx].title.rendered; |