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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require": { | |
"mfacenet/hello-world": "v1.*" | |
} | |
} |
- For your local dev, create a
Dockerfile
that is based on your production image and simply installxdebug
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 \
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 | |
""" | |
NewerOlder