Skip to content

Instantly share code, notes, and snippets.

View olibre's full-sized avatar
🦆
Empowering self-governance

O. Libre olibre

🦆
Empowering self-governance
View GitHub Profile
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active April 24, 2024 21:35
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@olibre
olibre / 60-jetbrains.conf
Last active September 9, 2019 14:18 — forked from bittner/60-jetbrains.conf
Inotify configuration for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm). Create this file with e.g. `sudo vim /etc/sysctl.d/60-jetbrains.conf`
# Set inotify watch limit high enough for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm).
# 1. Check current value in use: `cat /proc/sys/fs/inotify/max_user_watches`
# 2. Create this file as /etc/sysctl.d/60-jetbrains.conf (Debian, Ubuntu, Fedora...)
# 3. Apply new configuration: `sudo sysctl -p --system` or `sudo service procps start` or reboot
# 4. Check new value in use: `cat /proc/sys/fs/inotify/max_user_watches`
#
# References:
# * https://gist.github.com/olibre/a0219529a6cc347494f40780e7e539eb
# * https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
#
@olibre
olibre / cpp_legacy_inheritance_vs_std_variant.md
Last active February 11, 2024 10:41 — forked from GuillaumeDua/cpp_legacy_inheritance_vs_std_variant.md
C++ legacy inheritance vs CRTP + std::variant
@GuillaumeDua
GuillaumeDua / cpp_legacy_inheritance_vs_std_variant.md
Last active April 18, 2024 10:50
C++ legacy inheritance vs CRTP + std::variant
@olibre
olibre / smart_dtor.cpp
Last active October 7, 2018 21:10 — forked from odeblic/smart_dtor.cpp
Smart destructor
/*
* Original work: https://gist.github.com/odeblic/fa54037bf4d764a5dc02735cb4bd79f3
* Inspired from: https://youtu.be/ZiNGWHg5Z-o
*
* Compile
*
* $ g++ -Wall -Wextra smart_dtor.cpp
*
* Run
*
@odeblic
odeblic / smart_dtor.cpp
Last active October 7, 2018 21:10
Smart destructor
#include <iostream>
#include <memory>
struct Base
{
~Base()
{
std::cout << "~Base()" << std::endl;
}
};
@hutorny
hutorny / enumnames.hpp
Created January 21, 2017 18:05
Zero-dependency allocation-free mapping enum values to names for C++11
/** zero-dependency allocation-free mapping enum values to names */
namespace enumnames {
typedef const char* (*name)();
bool match(const char*, const char*) noexcept; /* to be provided by the user */
template<typename T, T K, name V>
struct tuple {
typedef T key_t;
static constexpr T key = K;

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@bittner
bittner / 60-jetbrains.conf
Created September 25, 2015 07:57
Inotify configuration for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm). Create this file with e.g. `sudo vim /etc/sysctl.d/60-jetbrains.conf`
# Set inotify watch limit high enough for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm).
# Create this file as /etc/sysctl.d/60-jetbrains.conf (Debian, Ubuntu), and
# run `sudo service procps start` or reboot.
# Source: https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
#
# More information resources:
# -$ man inotify # manpage
# -$ man sysctl.conf # manpage
# -$ cat /proc/sys/fs/inotify/max_user_watches # print current value in use
@subfuzion
subfuzion / http-status-codes.md
Last active September 3, 2023 09:15
General REST API HTTP Status Codes

Reference: RFC 2616 - HTTP Status Code Definitions

General

  • 400 BAD REQUEST: The request was invalid or cannot be otherwise served. An accompanying error message will explain further. For security reasons, requests without authentication are considered invalid and will yield this response.
  • 401 UNAUTHORIZED: The authentication credentials are missing, or if supplied are not valid or not sufficient to access the resource.
  • 403 FORBIDDEN: The request has been refused. See the accompanying message for the specific reason (most likely for exceeding rate limit).
  • 404 NOT FOUND: The URI requested is invalid or the resource requested does not exists.
  • 406 NOT ACCEPTABLE: The request specified an invalid format.