Skip to content

Instantly share code, notes, and snippets.

View iPAS's full-sized avatar
💭
Pursuing

Pasakorn Tiwatthanont iPAS

💭
Pursuing
View GitHub Profile
@iPAS
iPAS / assignment1.cpp
Created July 10, 2022 03:17
Some code of my learning on C++
#include <iostream>
using namespace std;
// Implicit type casting
float test_function(void) {
uint16_t a = 30;
float b = 10.4;
return a + b;
}
@iPAS
iPAS / Makefile
Created July 10, 2022 03:15
Makefile to compile .cpp to binary and assembly code.
# The build target
TARGET = assignment1
# the compiler: gcc for C program, define as g++ for C++
CC = clang++
# compiler flags:
# -g - this flag adds debugging information to the executable file
# -Wall - this flag is used to turn on most compiler warnings
@iPAS
iPAS / cayennelpp.js
Last active April 7, 2022 11:18
Cayenne Low-power Payload Decoder (javascript / node.js)
/**
* Cayenne Low-power Payload Library
*
* @author Pasakorn Tiwatthanont
* @email ptiwatthanont@gmail.com
*
* @link https://htmlcheatsheet.com/js/
*/
// console.log('Node.js version: ' + process.version)
format = require('string-format')
/*
* Copyright (c) 2007, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright