Skip to content

Instantly share code, notes, and snippets.

@iam-hussain
iam-hussain / default HTTP
Last active September 29, 2024 17:15
Serve nextJS app from a port through NGINX reverse proxy HTTP and HTTPS
# Serve nextJS app from a port through NGINX reverse proxy (HTTP)
# Path: /etc/nginx/sites-available/default
# Default server configuration for HTTP
server {
server_name www.DOMAINNAME.com DOMAINNAME.com;
# Serve any static assets with NGINX
location /_next/static {
alias /home/ubuntu/PROJECT_FOLDER/.next/static;
#!/usr/bin/env php
<?php
function getContents($params)
{
[$self, $file, $startLine, $startColumn, $endLine, $endColumn] = $params;
--$startLine;
--$startColumn;
--$endLine;
--$endColumn;
/*
1) Open https://popcat.click
2) Open console (F12)
3) Insert code & run
*/
var event = new KeyboardEvent('keydown', {
key: 'g',
ctrlKey: true
extension Date {
func add(_ component: Calendar.Component, value: Int) -> Date {
return Calendar.current.date(byAdding: component, value: value, to: self)!
}
}
@propertyWrapper
struct BeginEndDate {

Install Zsh and Oh-my-zsh on CentOS 7

Based on this article

ALL INSTALLATIONS ASSUME YES WHEN PROMPTED, that's what -y does

This script can be copy paste to ssh as is. No hands installation. :-)

yum install zsh -y
@blakethepatton
blakethepatton / Description.md
Last active November 7, 2023 09:37
Getting Mailhog running on a dev server (nginx, letsencrypt, ssl, ubuntu)

Get it running as a service

wget https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64

mv MailHog_linux_amd64 mailhog

chmod +x mailhog

sudo vi /etc/systemd/system/mailhog.service

//
// Navigator.swift
// tripani
//
// Created by Jesse Lin on 11/8/17.
// Copyright © 2017 Tripani. All rights reserved.
//
import Foundation
import UIKit
{"version":1,"resource":"file:///Users/huge/Desktop/www/ezbuild.quasar.hardhat.node/express-ts/src/Sdk/NFT.ts","entries":[{"id":"s8uH.ts","timestamp":1651332354243}]}
@1duo
1duo / centos.install.boost.md
Last active April 4, 2024 18:39
Install Boost library from source on CentOS 7.

Download Boost Library: http://www.boost.org (Choose the expected version)

wget https://cfhcable.dl.sourceforge.net/project/boost/boost/1.54.0/boost_1_54_0.tar.gz
wget https://phoenixnap.dl.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz
wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz
@gatesakagi
gatesakagi / drinkOrderAPI.gs
Last active November 14, 2022 17:30
Google App Script (讀取QueryString並寫入Sheet)
function doGet(e) {
//JSON.stringify(name)
if(typeof e !== 'undefined') {
var params = e.parameter;
var name = params.name;
var drinkIndex = params.drinkindex;
var drink = params.drink;
var drinkPrice = params.drinkprice;
var sugar = params.sugar;
var ice = params.ice;