Skip to content

Instantly share code, notes, and snippets.

@ampaze
ampaze / brotli-nginx-info.txt
Last active September 16, 2023 19:12
Serve static brotli compressed files on nginx without ngx_brotli
For this to work, you need to precompress your files:
> brotli -q 11 file.css file.cssbr
The file extensions needs to end with br without any delimiter, this is to make the nginx config less cumbersome.
@rikukissa
rikukissa / POST.md
Last active May 6, 2024 11:52
React Hook prompting the user to "Add to homescreen" 🏠 #PWA #React
title slug createdAt language preview
React Hook prompting the user to "Add to homescreen"
react-hook-prompting-the-user-to-add
2018-11-29T20:35:02Z
en
Simple React Hook for showing the user a custom "Add to homescreen" prompt.

React Hook for showing custom "Add to homescreen" prompt

@davidrichards
davidrichards / caudio
Last active December 7, 2021 02:00
Collecting ffmpeg snippets that work for me and converting them to reusable scripts.
#!/usr/bin/env bash
set -e
gain=${3-"1"}
if [ "$#" -lt 2 ]; then
echo "Usage: $0 input.aifc output.aifc [gain=2]"
exit 1
else

Rikomagic v5

chipset rk3288

Booting linux

Linux can be either stored in internal memory or on sd card

Flash bootloader

@andyshinn
andyshinn / composer.json
Last active February 18, 2024 12:05
Docker Compose PHP Composer Example
{
"require": {
"mfacenet/hello-world": "v1.*"
}
}
@chadrien
chadrien / README.md
Last active September 1, 2023 12:43
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 \
@akommareddi
akommareddi / Script Modify Headers
Last active May 22, 2023 08:19
HowTo: Script Modify Headers for Google Chrome extension using Selenium
System.setProperty("webdriver.chrome.driver",
"/opt/tools/selenium-2.45.0/chromedriver");
File addonpath = new File(
"/opt/tools/selenium-2.45.0/innpjfdalfhpcoinfnehdnbkglpmogdi.crx");
ChromeOptions options = new ChromeOptions();
options.addExtensions(addonpath);
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
@kellective
kellective / sds.md
Last active June 18, 2021 09:50
Shit developers say

Overheard in my team (circa 2015)

In a fit of refactoring madness I have gone and changed a lot

Did you seriously just give ME nil?... No!

If the shit sticks, then we put nice paint on it

Fucking red dot motherfucker (Ben and his failing specs)

@muffinresearch
muffinresearch / gist:7676683
Last active August 18, 2016 22:52
Building simg2img
git clone https://android.googlesource.com/platform/system/extras
cd extras/ext4_utils
git checkout android-4.1.1_r1
gcc -o simg2img -lz sparse_crc32.c simg2img.c
ln -s ${PWD}/simg2img ~/bin/simg2img
# Last step make sure ~/bin is in your $PATH.
@lovesh
lovesh / admin.py
Last active November 7, 2019 19:37
django-admin register all models
"""
Here models are in different modules and the models.py imports them from different modules like this
from model1 import * # or the name of models you want to import
from model2 import User
or you might write all your models in models.py
"""