This file contains 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 | |
echo(' <!DOCTYPE html> | |
<html> | |
<body> | |
<h1>Post received!</h1> | |
'); | |
?> | |
<?php | |
//You can output the post content to a file to be read later | |
file_put_contents('test.txt', file_get_contents('php://input')); |
This file contains 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
#!/bin/sh | |
# Called by "git push" after it has checked the remote status, | |
# but before anything has been pushed. | |
# | |
# If this script exits with a non-zero status nothing will be pushed. | |
# | |
# Steps to install, from the root directory of your repo... | |
# 1. Copy the file into your repo at `.git/hooks/pre-push` | |
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push` |
This file contains 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
import requests | |
headers = {'Authorization': 'token xxxxx'} | |
action = "jorgeacortes/stm32-cmake-docker/traffic/clones" | |
resp = requests.get('https://api.github.com/repos/'+ action, headers=headers) | |
print(resp.json()) |
This file contains 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
/** | |
* @brief Converts ADC_CHANNEL_TEMPSENSOR ADC value to Temperature in ºC. | |
* @param[in] sample ADC_CHANNEL_TEMPSENSOR value read. | |
* @return temperature in float. | |
* @note This temperature sensor measures junction temperature of the microcontroller. | |
* */ | |
float temp_calc(uint16_t sample) { | |
/* Factory calibrated values. Address for STM32F072x8 and STM32F072xB. Check datasheet for each microcontroller */ | |
const uint16_t ADC_TEMP_3V3_30C = *((uint16_t *)(0x1FFFF7B8)); | |
const float TEMP_30C = 30.0F; |
This file contains 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
union register32_t { | |
uint32_t val; | |
struct { | |
uint32_t b0:1; | |
uint32_t b1:1; | |
uint32_t b2:1; | |
uint32_t b3:1; | |
uint32_t b4:1; | |
uint32_t b5:1; | |
uint32_t b6:1; |
This file contains 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
/* 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; |
This file contains 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
# 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}\"") |
This file contains 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
// 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" |
This file contains 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
/** | |
* @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) |
This file contains 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
docker run --rm -v $(pwd):/home/node/app -v /home/node/app/node_modules node:latest bash -c "npm start" |
OlderNewer