Skip to content

Instantly share code, notes, and snippets.

View nsssayom's full-sized avatar
🏠
Working from home

Sayom Shakib nsssayom

🏠
Working from home
View GitHub Profile
@nsssayom
nsssayom / feed.php
Created April 30, 2017 10:10
Newsfeed Web service php
<?php
require_once "../includes/config.php";
$mconn = mysqli_connect($mq_host, $mq_user, $mq_pass, $mq_data);
$SQL = "SELECT `id`, `user`, `type`, `image`, `location`, `lat`, `lon`, `time` FROM `incident` ORDER BY `time` DESC LIMIT 0, 10";
$MQ = mysqli_query($mconn, $SQL);
$jq = array();
$uName = array();
if(mysqli_num_rows($MQ) > 0){
while($MFA = mysqli_fetch_array($MQ)){
$uid = $MFA['user'];
@nsssayom
nsssayom / signup.php
Created April 30, 2017 10:43
Sign Up form for Crowd Source Service
<?php
require_once "../includes/config.php";
if($_SERVER['REQUEST_METHOD'] == "POST"){
$mconn = mysqli_connect($mq_host, $mq_user, $mq_pass, $mq_data);
$first_name = mysqli_real_escape_string($mconn, $_POST['firstname']);
$last_name = mysqli_real_escape_string($mconn, $_POST['lastname']);
$password_1 = md5(mysqli_real_escape_string($mconn, $_POST['password_1']).$pSalt);
$password_2 = md5(mysqli_real_escape_string($mconn, $_POST['password_2']).$pSalt);
$mail = mysqli_real_escape_string($mconn, $_POST['email']);
@nsssayom
nsssayom / gist:0d35e548606e7a61d1993c85ed180e6e
Created February 25, 2019 16:28
Arithmetic infix to postfix
#include <iostream>
using namespace std;
char input[]="9+8*2/6";
char* head = input;
void expr();
void match(char ch);
void exprPrime();
void term();
@nsssayom
nsssayom / racing_game.cpp
Created July 31, 2019 15:33
a 2D racing game developed with OpenGL
#include<GL/glut.h>
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<limits.h>
#include<unistd.h>
#include<time.h>
#include<math.h>
#include<cstring>
#include<iostream>
@nsssayom
nsssayom / lexanaluzer.cpp
Created October 3, 2021 16:34
Simple lexical analyzer for arithmetic expression using C++
#include <iostream>
#include <string>
#include <sstream>
#include <cstring>
#include <boost/algorithm/string.hpp> // for detail: https://www.boost.org/
using namespace std;
// Structure for tokens
<!DOCTYPE html>
<html lang="en"
style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Signature</title>
<style>
#!/bin/bash
echo "Running pre-install script..."
# Update the system
sudo apt update -y
# Install required packages for building MQTT libraries and Mosquitto broker
sudo apt install -y build-essential gcc make cmake cmake-gui cmake-curses-gui libssl-dev doxygen graphviz git libusb-1.0-0-dev libsystemd0 libsystemd-dev mosquitto python3 python3-pip
@nsssayom
nsssayom / portfolio-template.json
Created September 8, 2023 16:31
JSON template for portfolio site
{
"title": "Sayom Shakib",
"titleLogo": null,
"favicon": null,
"nav": {
"navMenus": [
{
"name": "Home",
"page": "home"
},