The purpose of this document is to provide a complete overview of the PHP session
handler life cycle updated to version 7.0 or above. In particular, I want to
emphasize what methods and in what order are called when the native PHP functions
are used for session management.
I created this document because the information on the web and the official
documentation are very superficial on this topic, in particular on what
concerns the implementation of a safe and stable session handler.
Discover gists
{ | |
"estados": [ | |
{ | |
"sigla": "AC", | |
"nome": "Acre", | |
"cidades": [ | |
"Acrelândia", | |
"Assis Brasil", | |
"Brasiléia", | |
"Bujari", |
This script fetches all of the files from the currently deployed version of a Firebase Hosting site. You must be signed in via the Firebase CLI and have "Site Viewer" permission on the site in question to be able to properly run the script.
npx https://gist.github.com/mbleigh/9c8680cf319ace2f506f57380da66e7d <site_name>
async function trackVisit (request, visitorId) { | |
let data = { | |
token_auth: 'secret', | |
country: request.headers.get('CF-IPCountry'), | |
urlref: request.referrer || request.headers.get('Referer'), | |
idsite: 1, | |
lang: request.headers.get('Accept-Language'), | |
apiv: 1, | |
rand: Math.random().toString(16).slice(2), | |
url: request.url, |
See how a minor change to your commit message style can make a difference.
ℹ️ git-conventional-commits A CLI util to ensure this conventions and generate changelogs
theorem _root_.Nat.mod_eq_sub_div_mul {a b : Nat} : a % b = a - (a / b) * b := by | |
rw [eq_comm, Nat.sub_eq_iff_eq_add (Nat.div_mul_le_self _ _), Nat.mul_comm, Nat.mod_add_div] | |
theorem _root_.Nat.mod_eq_sub_mul_div {a b : Nat} : a % b = a - b * (a / b) := by | |
rw [Nat.mod_eq_sub_div_mul, Nat.mul_comm] | |
theorem _root_.BitVec.extractLsb_flatten (hi lo : Nat) {w : Nat} (vs : List (BitVec w)) | |
(w₁ : lo ≤ hi) (w₂ : hi < w * vs.length) (h : hi / w = lo / w) : | |
extractLsb hi lo (BitVec.flatten vs) = |
import Lean | |
opaque g (n : Nat) : Nat | |
@[simp] def f (i n m : Nat) := | |
if i < n then | |
f (i+1) n (g m) | |
else | |
m | |
termination_by n - i |
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
(() => { | |
const SHOW_SIDES = false; // color sides of DOM nodes? | |
const COLOR_SURFACE = true; // color tops of DOM nodes? | |
const COLOR_RANDOM = false; // randomise color? | |
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
const THICKNESS = 20; // thickness of layers | |
const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
// ==UserScript== | |
// @name Gist Downloader Plus | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0 | |
// @description Directly download GitHub gists as source files. | |
// @author Ahmed Mohamed Abdelaty | |
// @match https://gist.github.com/*/* | |
// @grant GM_addStyle | |
// @grant GM_xmlhttpRequest | |
// @grant GM_download |
Recently, during the migration to React 17, I had a problem between event listeners handled by React and one added document manually. It was due to this part on the React 17 release note.
At this moment I understood that I had a misconception of how React handles event listener. So I decided to explore the React code to understand how it works.
Before going deep in the React codebase, I would like to explain what was in my head about the management of event listeners.
For example when I write this simple code: