Skip to content

Instantly share code, notes, and snippets.

View mudassaralichouhan's full-sized avatar
:octocat:
It’s not a bug; it’s an undocumented feature.

Mudassar Ali mudassaralichouhan

:octocat:
It’s not a bug; it’s an undocumented feature.
View GitHub Profile
@jpneey
jpneey / util.session.php
Last active January 30, 2024 13:10
Session Helper Class to handle sessions in PHP consistently
<?php
/**
* Basic Session Helper Class
*
* A simple helper class for handling session consistently
*
* Usage Example:
* <?php
* require 'path/to/util.session.php';

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

@ayan-b
ayan-b / c-cpp-oops.md
Last active March 20, 2025 15:35
C, C++ & OOPS for Interviews
@ghassani
ghassani / QueryBuilder.php
Created September 19, 2018 18:28
Simple PHP SQL Query Builder for PDO
<?php
class QueryBuilder {
const QUERY_SELECT = 1;
const QUERY_INSERT = 2;
const QUERY_UPDATE = 3;
const QUERY_DELETE = 4;
const QUERY_REPLACE = 5;
const PARAMETER_STRING = 1;
@wildiney
wildiney / bearer-token.php
Last active February 11, 2024 18:55
[deprecated] PHP - How to get and set Bearer Token
<?php
/**
* ALERT! There are more than ten years since I wrote the first version (adaptation) of this code with PHP 5.6,
* then I changed my code stack and I couldn't mantain this code anymore. Ten years ago worked like a charm.
* Fell free to test, use, fork, update, etc. and if possible put in the comments how to fix,
* if it doesn't work for you as it is, so other people could find answers.
**/
/**
* Get hearder Authorization
@m0veax
m0veax / websocket-check.php
Last active July 25, 2024 05:23 — forked from htp/curl-websocket.sh
Test a WebSocket using php fsockopen, bit chaotic, but working for me. You can use that for a HTTP Sensor in PRTG or Nagios
<?php
error_reporting(-1);
$host = "your-host.tld"; // your websocket url without protocol part
$SecWebsocketKey = "your key from websocket connection"; // try wireshark or developer Tools to get this
$origin = "http://$host/"; // origin for the header
$host = 'localhost'; //where is the websocket server
@vilkoz
vilkoz / setup_http_server_on_android_with_termux.md
Last active March 19, 2025 20:13
setup http server on android with termux

Setting up http server on android with termux

Setting SSH server

To be able to make all procedures without pain you should have physical keyboard or just install ssh server and connect to your device shell from computer.

Folow this guide to setup ssh server.

Installing needed stuff

@asimshankar
asimshankar / README.md
Last active December 25, 2024 22:44
Training TensorFlow models in C++

Training TensorFlow models in C++

Python is the primary language in which TensorFlow models are typically developed and trained. TensorFlow does have bindings for other programming languages. These bindings have the low-level primitives that are required to build a more complete API, however, lack much of the higher-level API richness of the Python bindings, particularly for defining the model structure.

This file demonstrates taking a model (a TensorFlow graph) created by a Python program and running the training loop in C++.

@geocachecs
geocachecs / chess.cpp
Created October 22, 2015 21:53
2 Player Chess Game C++
#include "chess.h"
Square::Square()
{
piece = EMPTY;
color = NONE;
}
void Square::setSpace(Square* space)
@oriolrivera
oriolrivera / index.php
Created June 22, 2015 06:16
Simple Chat Using WebSocket and PHP Socket
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8' />
<style type="text/css">
<!--
.chat_wrapper {
width: 500px;
margin-right: auto;
margin-left: auto;