Skip to content

Instantly share code, notes, and snippets.

@snehesht
snehesht / gist:b91c9f62334a89641e802a5b5656d7c1
Created Dec 31, 2020 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:b91c9f62334a89641e802a5b5656d7c1

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@snehesht
snehesht / script.sh
Created Dec 15, 2020
Safe Bash Script
View script.sh
#!/usr/bin/env bash
set -Eeuo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1
trap cleanup SIGINT SIGTERM ERR EXIT
usage() {
cat <<EOF
@snehesht
snehesht / nginx_static_build.sh
Created Aug 19, 2020
Nginx v1.18.0 Static Build
View nginx_static_build.sh
wget https://nginx.org/download/nginx-1.18.0.tar.gz
tar zxvf nginx-1.18.0.tar.gz
cd nginx-1.18.0
wget https://ftp.pcre.org/pub/pcre/pcre-8.42.tar.gz && tar xzvf pcre-8.42.tar.gz
wget https://www.zlib.net/zlib-1.2.11.tar.gz && tar xzvf zlib-1.2.11.tar.gz
wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz && tar xzvf openssl-1.1.1g.tar.gz
rm -rf *.tar.gz
./configure \
View cnn.m3u8
#EXTM3U
#EXT-X-PUBLISHED-TIME:2020-04-08T15:52:55.874Z
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MEDIA:TYPE=CLOSED-CAPTIONS,GROUP-ID="cc",LANGUAGE="eng",NAME="Closed Captions",DEFAULT=YES,AUTOSELECT=YES,INSTREAM-ID="CC1"
#EXT-X-STREAM-INF:BANDWIDTH=4549339,AVERAGE-BANDWIDTH=3683433,CODECS="mp4a.40.2,avc1.4d401f",RESOLUTION=1280x720,FRAME-RATE=29.97,CLOSED-CAPTIONS="cc"
https://turnerlive.akamaized.net/hls/live/586495/cnngo/cnn_slate/VIDEO_0_3564000.m3u8?hdntl=exp=1586391164~acl=%2fhls%2flive%2f586495%2fcnngo%2f*!%2fhls%2flive%2f586495-b%2fcnngo%2f*~hmac=2845fe9b22ea4b1d76172cf056e0809afe57b4f65b24773900acde85a9705509
#EXT-X-STREAM-INF:BANDWIDTH=3309981,AVERAGE-BANDWIDTH=2661633,CODECS="mp4a.40.2,avc1.4d401f",RESOLUTION=960x540,FRAME-RATE=29.97,CLOSED-CAPTIONS="cc"
https://turnerlive.akamaized.net/hls/live/586495/cnngo/cnn_slate/VIDEO_1_2564000.m3u8?hdntl=exp=1586391164~acl=%2fhls%2flive%2f586495%2fcnngo%2f*!%2fhls%2flive%2f586495-b%2fcnngo%2f*~hmac=2845fe9b22ea4b1d76172cf056e0809afe57b4f65b24773900acde85a9705509
#EX
View gist:0ee486c8072bf2442e5c5adbfd0e313c
3|Braid WebSocket Server | Node - 2020-03-18T21:45:11.133Z - info - ╔══════════════════════╤══════════════╤═════════════╤══════════════╗
3|Braid WebSocket Server | Node - 2020-03-18T21:45:11.133Z - info - ║ Name │ Hits │ Misses │ Average Time ║
3|Braid WebSocket Server | Node - 2020-03-18T21:45:11.133Z - info - ╟──────────────────────┼──────────────┼─────────────┼──────────────╢
3|Braid WebSocket Server | Node - 2020-03-18T21:45:11.134Z - info - ║ getPermissionTargets │ 0 (0%) │ 255 (100%) │ 20.5ms ║
3|Braid WebSocket Server | Node - 2020-03-18T21:45:11.134Z - info - ╟──────────────────────┼──────────────┼─────────────┼──────────────╢
3|Braid WebSocket Server | Node - 2020-03-18T21:45:11.134Z - info - ║ getPermissionSources │ 2522 (87.8%) │ 352 (12.2%) │ 147.2ms ║
3|Braid WebSocket Server | Node - 2020-03-18T21:45:11.134Z - info - ╚══════════════════════╧══════════════╧═════════════╧══════════════╝
3|Braid WebSocke
View gist:cd41caea2dd7a9df29e8d4964ad6d676
EXPLAIN ANALYZE
SELECT
"id",
"start",
"end",
"start_miliseconds_since_midnight" AS "startMilisecondsSinceMidnight",
"end_miliseconds_since_midnight" AS "endMilisecondsSinceMidnight",
"monday",
"tuesday",
"wednesday",
View gist:e34e3fbacb8dac16b00f660ce64379a9
SELECT nodes.id AS target
FROM nodes
INNER JOIN permissions AS cdbaafababcdec ON nodes.id = cdbaafababcdec.target INNER JOIN edges AS parentEdges ON nodes.id = parentEdges.child
WHERE cdbaafababcdec.source IN('a6630b37-84be-0d10-3d2e-828df19e2c11', 'aee255bc-1111-4754-b4b9-99c9eb731ac6', '0cc316f9-3add-4070-9639-511854b4c2bf', '7f05aa6a-a0cd-49d2-9a95-f20e9bc345c3', '4a0bd8dc-24ee-4b19-bbf0-6ed6d73ffb87', 'df628c24-bf69-4c90-81cb-54e24ab5e79c', '152b344e-c9e1-4c56-95ce-ea3865d8a9c3', 'ed71e5e5-d5d2-4cf3-a208-a961d15966df', '64f2818b-cd41-49d0-900e-8ab610490bff', '69a6350c-4aa8-4da1-a691-c26f6f7e86d3', '3bce1ea5-012e-4f18-8e5a-64f5ca57c8bb', '9285951e-1f4e-4f52-96dc-6116a5c1d17c', 'a138400b-0912-43a5-9d77-3c5b86a6d468', '885e86a0-b85c-4516-857d-2eb2f75a86fd', '856c30d5-20e0-4b91-9fbb-c5ee08509e56', '5aa9c327-168e-48c6-8ab5-b2f33ab55251', '62c3cc50-0f65-450f-8034-3dfee31b6697', '73ab8806-d0b1-4168-a5a5-462dff5ddaec', '3aaa7d39-930b-48a2-911a-7f8a393e3ab5', 'd5f3a5
@snehesht
snehesht / plink-plonk.js
Created Feb 16, 2020 — forked from tomhicks/plink-plonk.js
Listen to your web pages
View plink-plonk.js
View PG Metrics
pgmetrics run at: 14 Feb 2020 4:58:16 PM (now)
PostgreSQL Cluster:
Name: PostgreSQL
Server Version: 11.0 (Ubuntu 11.0-1.pgdg16.04+2)
Server Started: 14 Feb 2020 4:41:59 PM (16 minutes ago)
System Identifier: 6615636975566673716
Timeline: 2
Last Checkpoint: 14 Feb 2020 4:55:12 PM (3 minutes ago)
@snehesht
snehesht / sysctl.conf
Created Feb 12, 2020 — forked from voluntas/sysctl.conf
Sysctl configuration for high performance
View sysctl.conf
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2