Skip to content

Instantly share code, notes, and snippets.

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

Nazmul Alam nazmulpcc

🏠
Working from home
View GitHub Profile
@nazmulpcc
nazmulpcc / qt-demo.php
Created January 29, 2025 16:27
Experimental QT integration with PHP
<?php
use Qt\Widgets\QApplication;
use Qt\Widgets\QCheckBox;
use Qt\Widgets\QMainWindow;
use Qt\Widgets\QLineEdit;
use Qt\Widgets\QPushButton;
use Qt\Widgets\QVBoxLayout;
use Qt\Widgets\QWidget;
@nazmulpcc
nazmulpcc / python-webview.py
Created August 6, 2023 08:08
Calling webview from python
from ctypes import CDLL, c_int, c_char_p, c_void_p
# Load the shared library
# https://github.com/webview/webview/
libwebview = CDLL('/path/to/libwebview.so')
# Define the functions with their argument types and return types
libwebview.webview_create.argtypes = [c_int, c_void_p]
libwebview.webview_create.restype = c_void_p
libwebview.webview_navigate.argtypes = [c_void_p, c_char_p]
@nazmulpcc
nazmulpcc / .git-alias.sh
Created August 2, 2023 17:27
Aliases for git commands
alias gs='git status'
alias gc='git commit -S -m'
alias ga='git add '
alias gca='git commit -S -a -m'
alias gd='git diff '
alias gt="git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias gl="git log"
alias gp="git push"
alias gpl="git pull"
alias gk="git checkout"
@nazmulpcc
nazmulpcc / override.cpp
Last active April 5, 2023 13:29
C++ Function override example.
#include<iostream>
#include <string>
// Generated by ChatGPT. See here: https://sharegpt.com/c/ugfKoX4
class Animal
{
public:
Animal(std::string name) : name(name) {}
@nazmulpcc
nazmulpcc / .aliases
Created October 21, 2021 09:53
Shell Aliases
alias update='sudo pacman -Syu --noconfirm' # for manjaro, arch etc
#alias update='brew update && brew upgrade' # for mac
#alias update='sudo apt update && sudo apt upgrade -y'
alias ll='ls -la'
# Git
alias gs='git status'
alias gc='git commit -m'
@nazmulpcc
nazmulpcc / Dockerfile
Created July 16, 2020 10:00
Multistage Dockerfile for very small PHP docker image based on Alpine linux.
FROM php:7.4.7-cli-alpine3.12 as build
RUN apk update && \
apk add --no-cache \
gmp-dev \
libxml2-dev \
libpng-dev \
freetype-dev \
libjpeg-turbo-dev \
libwebp-dev \
@nazmulpcc
nazmulpcc / Dockerfile
Created July 9, 2020 15:00
Generate valid ssl certificates using certbot+cloudflare plugin inside a docker container.
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND noninteractive
RUN add-apt-repository -y ppa:certbot/certbot && \
apt-get install -yq certbot python3-certbot-dns-cloudflare curl
COPY certbot.sh /tmp
COPY ./init.sh /tmp
@nazmulpcc
nazmulpcc / nginx-tuning.md
Created June 13, 2020 18:46 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@nazmulpcc
nazmulpcc / a.c
Created January 1, 2020 08:03
Contest Link: https://codeto.win/contest/28 password: mock1920
DO YOURSELF
DO YOURSELF