Skip to content

Instantly share code, notes, and snippets.

View samueltcsantos's full-sized avatar

Samuel Santos samueltcsantos

  • Signove Tecnologia S/A
  • Campina Grande, PB-Brazil
View GitHub Profile
#include <ESP8266WiFi.h>
const char* ssid = "Wi-Fi_Network";
const char* password = "network#123";
WiFiServer server(80);
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
@samueltcsantos
samueltcsantos / overflow.c
Created May 20, 2017 23:44
Trying to do underflow and overflow in C language for the integer Type.
#include <stdio.h>
#include <limits.h>
int main(){
int maxValue = INT_MAX;
int minValue = INT_MIN;
int overflow = 0;
int underflow = 0;
@samueltcsantos
samueltcsantos / decimal-hexa.c
Last active May 6, 2017 17:13
Convert from decimal to hexadecimal
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BITS 64
/**
* @desc Algorithm to convert decimal to hexadecimal.
*
* Compile: gcc decimal-hexa.c -o toHex
@samueltcsantos
samueltcsantos / binary-to-decimal.c
Created May 3, 2017 02:08
Convert Binary to Decimal
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
/**
* @desc Algorithm to convert binary to decimal number.
*
* Compile: gcc binary-to-decimal.c -o toDecimal -lm
* Run: ./toDecimal 10100101
*
@samueltcsantos
samueltcsantos / binary-little-endian.c
Created May 2, 2017 00:42
Converter decimal to binary using the little endian format.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define BIT_0 "0"
#define BIT_1 "1"
/**
@samueltcsantos
samueltcsantos / reverse.c
Created May 1, 2017 16:04
Reverse the string content using a function.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/**
* @desc Algorithm to reverse a string passed by command line as argument.
*
* Compile: * gcc -o reverse.c -o reverse
* Run: ./reverse SAMARA
*
@samueltcsantos
samueltcsantos / invert-string.c
Created May 1, 2017 00:44
Reverse a text algoritm
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/**
* @desc Algorithm to reverse a string passed by command line as argument.
*
* Compile: * gcc -o invert-string.c -o invert
* Run: ./invert SAMARA
*
@samueltcsantos
samueltcsantos / binary-bigendian.c
Last active May 1, 2017 20:00
Convert decimal to binary using Big-Endian notation.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define BIT_0 "0"
#define BIT_1 "1"
int main(int argc , char **argv){
@samueltcsantos
samueltcsantos / binary.c
Created April 29, 2017 15:16
How to read arguments from command line.
#include <stdio.h>
int main(int argc , char **argv){
for (int i=0; i < argc; ++i)
{
printf("argv[%d]: %s \n", i, argv[i]);
}
}
@samueltcsantos
samueltcsantos / bower.js
Created December 3, 2016 01:51 — forked from PascalAnimateur/bower.js
Configure grunt-bower-task with Sails.js (Bootstrap + jQuery as example)
/**
* Task to pull out specific files from bower packages.
*/
module.exports = function (grunt) {
grunt.config.set('bower', {
install: {
options: {
layout: function(type, component) {
return type;
},