Skip to content

Instantly share code, notes, and snippets.

@BretFisher
BretFisher / Dockerfile
Last active June 27, 2024 13:43
WIP sample Laravel php_fpm plus nginx plus supervisor Docker setup with npm, composer, bower, and more
FROM yourdockername/base-php-nginx:latest AS build
# BUILD STAGE
# the primary reason we have two build stages is so SSH key of private repo's will never
# be in final image
# COPY IN BUILD SSH KEY
# It won't be copied to final image
# add this build arg to compose file
ARG BUILDKEY
RUN if [ -z "$BUILDKEY" ]; then echo "BUILDKEY SSH NOT SET - ERROR"; exit 1; else : ; fi
@onigetoc
onigetoc / IPTV-big-list.m3u
Last active April 16, 2025 14:18
IPTV big list.m3u
#EXTM3U
#EXTINF:0 tvg-name="Newsmax TV" tvg-language="English" tvg-country="CA" tvg-id="Newsmax-TV" tvg-logo="https://i.imgur.com/Twkovic.gif" group-title="Entertainment",Newsmax TV
https://nmxlive.akamaized.net/hls/live/529965/Live_1/index.m3u8
#EXTINF:0 tvg-logo="https://i.imgur.com/ODIWC6n.jpg" tvg-name="Infowars1" tvg-id="Infowars1" group-title="News",Infowars Live1
https://infostream.secure.footprint.net/hls-live/infostream-infostream/_definst_/master.m3u8
#EXTINF:0 tvg-logo="https://i.imgur.com/ODIWC6n.jpg" tvg-name="Infowars" tvg-id="Infowars" group-title="News",Infowars Live 2
https://infowarslive-lh.akamaihd.net/i/infowarsevent_1@366809/master.m3u8
#EXTINF:0 tvg-name="Russia today News" tvg-country="RU" tvg-language="English" tvg-logo="https://i.imgur.com/QY4B8Hg.png" group-title="News",RT News
https://rt-news-gd.secure2.footprint.net/1103.m3u8
#EXTINF:0 tvg-name="Russia today USA" tvg-country="RU" tvg-language="English" tvg-logo="https://i.imgur.com/QY4B8Hg.png" group-title="News",RT USA
export default [
{ id: 'AF',
name: 'Afghanistan',
continent: 'Asia',
currencyId: 'AFN',
phoneCode: '93',
flag: '🇦🇫' },
{ id: 'AX',
name: 'Åland Islands',
continent: 'Europe',
@denneulin
denneulin / tips.js
Last active March 14, 2019 12:56
Tips
const _ = require('lodash');
const str = '1dé@#j. à$42^ù`=:/+%M£¨-)àç!Їжакè§("^é& vu';
// exclude all special characters and spaces in a string
const result = _.deburr(str).replace(/\W/g, '');
// result = 1deja42uMaceevu
// exclude all special characters and replaces spaces by underscore in a string
// N spaces side by side = 1 underscore
const result = _.deburr(str).replace(/[^\w\s]/g, '').trim().replace(/\s+/g, '_');
@tolu
tolu / A-ES6-examples-readme.md
Last active September 10, 2018 08:32
Modern javascript examples with old counterparts

leaflet+riot

@ericelliott
ericelliott / assigning-yield-results.js
Last active September 10, 2018 08:32
Assigning `yield` results...
const next = (iter, callback, prev = undefined) => {
// 2. The yielded value is extracted by calling
// .next(). We pass the previous value back into
// the generator for assignment.
const item = iter.next(prev);
const value = item.value;
// 4. The final value gets passed to the callback.
if (item.done) return callback(prev);
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active January 9, 2025 12:22
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@mxriverlynn
mxriverlynn / 0.js
Last active September 10, 2018 08:33
recursing a tree structure with ES6 generators
function *doStuff(){
yield 1;
yield 2;
yield *doStuff();
}
var it = doStuff();
var res;
res = it.next();