Skip to content

Instantly share code, notes, and snippets.

View aliabidzaidi's full-sized avatar
🌱

Ali Abid Zaidi aliabidzaidi

🌱
View GitHub Profile
@cslarsen
cslarsen / human-numbers.cpp
Created February 20, 2012 18:44
Convert big number to human readable format
/*
* A simple way to format numbers as human readable strings.
* E.g., 123456789 ==> 123 million
*
* Written by Christian Stigen Larsen
* http://csl.sublevel3.org
*
* Placed in the public domain by the author, 2012
*/
@ashwin
ashwin / getopt_long_example.cpp
Last active April 5, 2023 21:42
How to parse options in C++ using getopt_long
#include <getopt.h>
#include <iostream>
int num = -1;
bool is_beep = false;
float sigma = 2.034;
std::string write_file = "default_file.txt";
void PrintHelp()
{
@albertodebortoli
albertodebortoli / change_author_git_commit.md
Last active November 10, 2023 08:41
Change the author of a commit in Git

Using Interactive Rebase

git rebase -i -p <some HEAD before all of your bad commits>

Then mark all of your bad commits as "edit" in the rebase file, and when git asks you to amend each commit, do

git commit --amend --author "New Author Name <email@address.com>"

edit or just close the editor that opens, and then do

Byobu is a suite of enhancements to tmux, as a command line
tool providing live system status, dynamic window management,
and some convenient keybindings:
F1 * Used by X11 *
Shift-F1 Display this help
F2 Create a new window
Shift-F2 Create a horizontal split
Ctrl-F2 Create a vertical split
Ctrl-Shift-F2 Create a new session
@mnlcandelaria
mnlcandelaria / zeromq.sh
Last active May 4, 2024 06:26
How to install ZeroMQ on Ubuntu
# run in sudo
# Before installing, make sure you have installed all the needed packages
sudo apt-get install libtool pkg-config build-essential autoconf automake
sudo apt-get install libzmq-dev
# Install libsodium
git clone git://github.com/jedisct1/libsodium.git
cd libsodium
./autogen.sh
./configure && make check
@sanchezzzhak
sanchezzzhak / clickhouse-get-tables-size.sql
Created January 18, 2018 13:43
clickhouse get tables size
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@fxmontigny
fxmontigny / get-set-html-quilljs-editor.js
Last active March 20, 2024 16:27
Insert and get html content with quilljs editor
const editor = $('.editor');
const quill = new Quill(editor);
// set html content
quill.setHTML = (html) => {
editor.root.innerHTML = html;
};
// get html content
@hamzahamidi
hamzahamidi / open-cmder-here.md
Last active June 14, 2024 15:37
"Open Cmder Here" in context menu

"Open Cmder Here" in context menu

Edit 04/2021:

As of the lastest versions, just execute the following command .\cmder.exe /REGISTER ALL per Documentation.

Original Solution

To add an entry in the Windows Explorer context menu to open Cmder in a specific directory, paste this into a OpenCmderHere.reg file and double-click to install it.

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH