Skip to content

Instantly share code, notes, and snippets.

View php-cpm's full-sized avatar

zouyi php-cpm

View GitHub Profile
@jboner
jboner / latency.txt
Last active April 24, 2024 00:20
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@alexnederlof
alexnederlof / selenium-start-stop.sh
Created November 20, 2012 19:49
Selenium start-stop script
#!/bin/bash
# Note that this script requires you to have
# an X window running on Display :90
# This can be done by running: /usr/bin/Xvfb :90 -ac -screen 0 1024x768x8 &
#
# You can save this script as /etc/init.d/selenium to start and stop selenium
PORT=4443
DESC="Selenium server"
0 = Success
1 = Operation not permitted
2 = No such file or directory
3 = No such process
4 = Interrupted system call
5 = Input/output error
6 = No such device or address
7 = Argument list too long
8 = Exec format error
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@huqi
huqi / trial.key
Created April 11, 2015 09:01
Beyond Compare 4 license for Mac
Beyond Compare 4
Licensed to: ASIO Allsoftinone
Quantity: 1 user
Serial number: 1822-9597
License type: Pro Edition for Windows
--- BEGIN LICENSE KEY ---
H1bJTd2SauPv5Garuaq0Ig43uqq5NJOEw94wxdZTpU-pFB9GmyPk677gJ
vC1Ro6sbAvKR4pVwtxdCfuoZDb6hJ5bVQKqlfihJfSYZt-xVrVU27+0Ja
hFbqTmYskatMTgPyjvv99CF2Te8ec+Ys2SPxyZAF0YwOCNOWmsyqN5y9t
@barryvdh
barryvdh / lumen_ide_helper.php
Last active April 10, 2023 10:26
Lumen IDE Helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel Lumen (5.1.1) (Laravel Components 5.1.*) on 2015-08-18.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
@stevethomas
stevethomas / Myapp.php
Last active September 2, 2020 17:53
Example of how to extend Lumen monolog implementation for New Relic and potentially other handlers
<?php namespace Foo;
// app/Myapp.php
use Monolog\Logger;
use Laravel\Lumen\Application;
use Monolog\Handler\StreamHandler;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\NewRelicHandler;
class Myapp extends Application
@52cik
52cik / npm.taobao.sh
Last active February 29, 2024 02:56
npm 淘宝镜像配置
npm set registry https://r.npm.taobao.org # 注册模块镜像
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron 二进制包镜像
npm set ELECTRON_MIRROR https://cdn.npm.taobao.org/dist/electron/ # electron 二进制包镜像
npm set puppeteer_download_host https://npm.taobao.org/mirrors # puppeteer 二进制包镜像
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver # chromedriver 二进制包镜像
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver # operadriver 二进制包镜像
@Niteshvgupta
Niteshvgupta / readme.md
Last active March 1, 2023 02:15
Install PHP7-compatible memcache on Mac OS X

1. Install PHP7 with brew

brew install php70

2. Install Memcache from source on PHP7 branch

git clone -b NON_BLOCKING_IO_php7 https://github.com/websupport-sk/pecl-memcache.git
cd pecl-memcache
phpize
./configure
make &amp;&amp; make install
@yannbertrand
yannbertrand / using_xdebug_with_postman.md
Created December 6, 2016 15:04
Using xDebug with POSTMAN

Set the url with ?XDEBUG_SESSION_START=PHPSTORM and set a header Cookie: XDEBUG_SESSION=PHPSTORM