Skip to content

Instantly share code, notes, and snippets.

View Danack's full-sized avatar

Danack

  • Bristol, England
View GitHub Profile
@jaredpalmer
jaredpalmer / react-scripts+3.4.1.patch
Created May 26, 2020 14:46
Speed up Create React App with TypeScript in development
diff --git a/node_modules/react-scripts/config/webpack.config.js b/node_modules/react-scripts/config/webpack.config.js
index 25840d9..25c3c41 100644
--- a/node_modules/react-scripts/config/webpack.config.js
+++ b/node_modules/react-scripts/config/webpack.config.js
@@ -172,7 +172,7 @@ module.exports = function(webpackEnv) {
// The build folder.
path: isEnvProduction ? paths.appBuild : undefined,
// Add /* filename */ comments to generated require()s in the output.
- pathinfo: isEnvDevelopment,
+ pathinfo: false,
@jasny
jasny / CMakeList.txt
Created October 7, 2019 01:21
CMake configuration for php-src
cmake_minimum_required(VERSION 3.8)
project(php C)
# 32bit or 64bit
set(BITNESS 32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(BITNESS 64)
endif()
# Global definitions
@Danack
Danack / gist:6bd30de6247bc5148986
Last active April 13, 2017 08:23
PHP memory recursive.
<?php
$performGC = false;
if ($performGC) {
echo "GC collection will be done - app should not crash.\n";
}
else {
echo "GC collection won't be done - app should crash.\n";

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this-&gt;anything()
@DaveRandom
DaveRandom / ContentType.php
Last active December 20, 2015 06:59
PHP Content-Type negotiation
<?php
/**
* Represents a MIME content type
*
* @author Chris Wright <github@daverandom.com>
*/
class ContentType
{
/**
@hydra35
hydra35 / batch-strace.sh
Created February 23, 2012 14:31
strace all the php-fpm worker processes
#!/bin/bash
additional_strace_args="$1"
MASTER_PID=$(ps auwx | grep php-fpm | grep -v grep | grep 'master process' | cut -d ' ' -f 6)
while read -r pid;
do
if [[ $pid != $MASTER_PID ]]; then
nohup strace -r -p "$pid" $additional_strace_args >"$pid.trc" 2>&1 &