Skip to content

Instantly share code, notes, and snippets.

View Huynt-dev's full-sized avatar
💭
(⌐■_■

Huy Nguyen (David) Huynt-dev

💭
(⌐■_■
View GitHub Profile
@sanrandry
sanrandry / nginx_sites-available_folder_not_found.md
Last active February 20, 2024 00:21
nginx sites-available folder not found

nginx sites-available folder not found

create the sites-available and sites-enabled folder

sudo mkdir /etc/nginx/sites-available
sudo mkdir /etc/nginx/sites-enabled

edit the http block inside /etc/nginx/nginx.conf and add this line

include /etc/nginx/sites-enabled/*;
@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@benkulbertis
benkulbertis / cloudflare-update-record.sh
Last active March 4, 2024 11:27
Cloudflare API v4 Dynamic DNS Update in Bash
#!/bin/bash
# CHANGE THESE
auth_email="user@example.com"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)