Skip to content

Instantly share code, notes, and snippets.

View php-cpm's full-sized avatar

zouyi php-cpm

View GitHub Profile
@GLMeece
GLMeece / latency_numbers.md
Last active April 29, 2024 09:47
Latency Numbers Every Programmer Should Know - MarkDown Fork

Latency Comparison Numbers

Note: "Forked" from Latency Numbers Every Programmer Should Know

Event Nanoseconds Microseconds Milliseconds Comparison
L1 cache reference 0.5 - - -
Branch mispredict 5.0 - - -
L2 cache reference 7.0 - - 14x L1 cache
Mutex lock/unlock 25.0 - - -
@Mohamed3on
Mohamed3on / The Technical Interview Cheat Sheet.md
Last active April 23, 2020 20:47 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is a fork to fix the markdown errors in the original gist.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

Array

Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@danisfermi
danisfermi / setupdb.md
Created December 15, 2017 23:00
Setup gdb on Mac OS Sierra/High Sierra

Here are the steps to installing and setting up GDB on Mac OS Sierra/High Sierra. Run brew install gdb. On starting gdb, you will get the following error:

Unable to find Mach task port for process-id 2133: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))

To fix this error, follow the following steps:

@laurencei
laurencei / gist:d46893f833d5ddd439eccff025a0b63a
Last active May 7, 2021 16:40
Lumen vs Laravel performance steps
Steps to recreate tests:
// Create and configure server:
1. Create 2GB DigitalOcean server using Forge
2. Enable OpCache on server
3. Create http://domain1.com (use whatever domain name you have available)
4. Create http://domain2.com (use whatever domain name you have available)
5. Enable SSL on both domains using LetsEncrypt
6. Install: sudo apt-get install apache2-utils
@thomasdarimont
thomasdarimont / docker-compose.yml
Created January 25, 2019 17:52
Docker OpenLDAP + phpldapadmin example
version: '2'
services:
openldap:
image: osixia/openldap:1.2.3
container_name: openldap
environment:
LDAP_LOG_LEVEL: "256"
LDAP_ORGANISATION: "Example Inc."
LDAP_DOMAIN: "example.org"
LDAP_BASE_DN: ""
@php-cpm
php-cpm / parse.php
Last active August 25, 2023 10:48
apple iap App Store Server Notifications V2 parse code
<?php
$error = ['code'=>0,'msg'=>''];
$req = json_decode(file_get_contents("php://input"), true);
if (//https://developer.apple.com/documentation/appstoreservernotifications/responsebodyv1
!isset($req['environment']) ||
//https://developer.apple.com/documentation/appstoreservernotifications/responsebodyv2
!isset($req['signedPayload']) {
$error = ['code' => 400, 'msg' => 'params error'];
return $error;
}