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 January 24, 2024 19:27
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 February 13, 2023 17:20 — 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 27, 2024 18:18
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

Serial Keys:
YV54A-2ZW5P-M887Y-UWXNE-QPUXD
VY3R2-0NW0L-H845Q-TDMXT-XQAT0
VC7JR-A0Z97-08EGZ-M4YNV-XVHD0
FC1TU-4RGEQ-084EP-2XQQX-ZGHWA
CU1WA-8HGEN-M815Z-HQP5E-QKADF
AY7D0-FTG44-H846Y-2XPGV-P32T8
If i request you to be my mentor, what will you teach? comment below.
@asimshankar
asimshankar / README.md
Last active January 28, 2024 17:24
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++.

@fruitl00p
fruitl00p / bench.php
Created October 13, 2016 08:58
gzdeflate / gzcompress / gzencode
<?php
// GLOBALS available: $db, $currentImplementation, $currentUser, $currentSite, $currentPage
// PARAMS available: $sqlArray (array), $request (Web_request)
//
// GLOBALS available: $db, $currentImplementation, $currentUser, $currentSite, $currentPage
// PARAMS available: $sqlArray (array), $request (Web_request)
//
$string = 'thisismystringthisismystringthisismystringthisismystringthisis'
. 'mystringthisismystringthisismystringthisismystringthisismystringthisismystringthisismystringthisismystringthisismystringthis'
. 'ismystringthisismystringthisismystringthisismystringthisismystringthisismystringthisismystringthisismystringthisismystringth'