Skip to content

Instantly share code, notes, and snippets.

@tjunghans
tjunghans / node-v8-max-old-space-size.md
Last active November 18, 2023 20:17
Node V8 max-old-space-size

Node V8 Option max-old-space-size

Command line

node --help --v8-options | grep -B 1 -A 1 max-old-space
        type: bool  default: false
  --max-old-space-size (max size of the old space (in Mbytes))
        type: size_t  default: 0
@swalkinshaw
swalkinshaw / application.php
Created November 17, 2019 17:29
Trellis + Sentry
<?php
/**
* composer require sentry/sentry-sdk
*/
use Sentry;
Env::init();
// Bedrock application config...
if (env('SENTRY_DSN')) {
Sentry\init([
'dsn' => env('SENTRY_DSN'),
@jakub-g
jakub-g / async-defer-module.md
Last active June 29, 2024 11:47
async scripts, defer scripts, module scripts: explainer, comparison, and gotchas

<script> async, defer, async defer, module, nomodule, src, inline - the cheat sheet

With the addition of ES modules, there's now no fewer than 24 ways to load your JS code: (inline|not inline) x (defer|no defer) x (async|no async) x (type=text/javascript | type=module | nomodule) -- and each of them is subtly different.

This document is a comparison of various ways the <script> tags in HTML are processed depending on the attributes set.

If you ever wondered when to use inline <script async type="module"> and when <script nomodule defer src="...">, you're in the good place!

Note that this article is about <script>s inserted in the HTML; the behavior of <script>s inserted at runtime is slightly different - see Deep dive into the murky waters of script loading by Jake Archibald (2013)

@Francesco149
Francesco149 / docker-cross-device-link.md
Last active October 27, 2023 08:51
docker error creating new backup file '/var/lib/dpkg/status-old': Invalid cross-device link
@austinpray
austinpray / bad.jsx
Last active September 19, 2018 19:43
PostListing Refactor. I'm using .jsx filenames so I can get proper filenames in the gist use .js or typescript in your project
import React from 'react'
const PostListing = ({post}) => (
<article>
<h3>{post.frontmatter.title}</h3>
<span>{post.frontmatter.date}</span>
<p>{post.excerpt}</p>
</article>
)
@SrPhilippe
SrPhilippe / vrchat-dynamic-bone-config.md
Last active May 31, 2024 12:01
Nice configs for dynamic bone to use on VRChat

Vrchat dynamic bone configs

Hair

Normal Long Hair Other
name value name value name value
damping 0.2 damping 0.894 damping 0.025
elasticity 0.05 elasticity 0.1 elasticity 0.008
stiffness 0.8 stiffness 0.783 stiffness 0.85
@QWp6t
QWp6t / Bootstrap.php
Created April 16, 2017 03:20
NavWalkers
<?php namespace App\NavWalker;
use Roots\Soil\Nav\NavWalker as SoilNavWalker;
/**
* @author QWp6t
* @license OSL-3.0
*/
class Bootstrap extends SoilNavWalker
{
@tolitius
tolitius / nginx.conf
Last active June 24, 2023 10:03
openresty (nginx + lua): redis connection pooling
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
init_worker_by_lua_block {
redis = require("resty.redis")
}
server {
@jehaby
jehaby / README.md
Last active January 25, 2024 14:43 — forked from chadrien/README.md
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
    && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@Restuta
Restuta / the-bind-problem.jsx
Last active March 16, 2024 00:22
React, removeEventListener and bind(this) gotcha
/* Sometimes it's pretty easy to run ito troubles with React ES6 components.
Consider the following code: */
class EventStub extends Component {
componentDidMount() {
window.addEventListener('resize', this.onResize.bind(this)); //notice .bind
}
componentWillUnmount() {
window.removeEventListener('resize', this.onResize.bind(this));