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
body { padding: 50px; } | |
ul { | |
max-height:300px; | |
overflow:auto; | |
} | |
/* Overwrite the default to keep the scrollbar always visible */ | |
::-webkit-scrollbar { |
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
static inline uint32_t __iter_div_u64_rem(uint64_t dividend, uint32_t divisor, uint64_t *remainder) | |
{ | |
uint32_t ret = 0; | |
while (dividend >= divisor) { | |
/* The following asm() prevents the compiler from | |
optimising this loop into a modulo operation. */ | |
asm("" : "+rm"(dividend)); | |
dividend -= divisor; |
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
static inline int16_t get_average_signal_level(const unsigned char* buffer, uint16_t buffer_size) | |
{ | |
int sum = 0; | |
uint16_t samples = buffer_size/2; | |
const short* pcm = (const short*)buffer; | |
const short* end = pcm + samples; | |
while(pcm != end) | |
{ | |
if (*pcm < 0) | |
sum -= *pcm++; |
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
curl -X POST http://localhost/script.php -d '{"param1":value,"param2":"value"}' -H "Content-type: application/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
void check_eth_ip_address() | |
{ | |
struct ifaddrs *ifaddr = NULL; | |
struct ifaddrs *ifa = NULL; | |
getifaddrs(&ifaddr); | |
for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) | |
{ | |
if (ifa->ifa_addr->sa_family == AF_INET) |