Skip to content

Instantly share code, notes, and snippets.

View NickNaso's full-sized avatar
🎯
Focusing

Nicola Del Gobbo NickNaso

🎯
Focusing
View GitHub Profile
@NickNaso
NickNaso / nextjs-deploy.md
Created August 1, 2023 10:57 — forked from jjsquady/nextjs-deploy.md
Deploying NEXTJS site with nginx + pm2

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

@NickNaso
NickNaso / main.c
Created March 2, 2023 20:04 — forked from menangen/main.c
QuickJS C API
//
// main.c
// testQJS
//
// Created by menangen on 15/08/2019.
// Copyright © 2019 menangen. All rights reserved.
//
#include "quickjs.h"
#include "quickjs-libc.h"
@NickNaso
NickNaso / GitHub curl.sh
Created December 15, 2021 12:32 — forked from Integralist/GitHub curl.sh
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
# Example...
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"
@NickNaso
NickNaso / imagemagick.bash
Created December 6, 2021 12:09 — forked from bensie/imagemagick.bash
ImageMagick Static Binaries for AWS Lambda
#!/usr/bin/env bash
# Must be run on an Amazon Linux AMI that matches AWS Lambda's runtime which can be found at:
# https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html
#
# As of May 21, 2019, this is:
# Amazon Linux AMI 2018.03.0 (ami-0756fbca465a59a30)
#
# You need to prepend PATH with the folder containing these binaries in your Lambda function
# to ensure these newer binaries are used.
@NickNaso
NickNaso / default nginx configuration file
Created December 6, 2021 09:46 — forked from xameeramir/default nginx configuration file
The default nginx configuration file inside /etc/nginx/sites-available/default
## Personal note: Muslims are not terrorists and I humbly request my engineering community to help end racism.
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@NickNaso
NickNaso / README.md
Created December 5, 2020 10:22 — forked from kentcdodds/README.md
user-package-stats

user-package-stats

I was poking around trying to figure out all the packages I have access to publish and got curious. So I write this little script to determine the download stats for all the packages I have publish access to.

Feel free to try it yourself. Just change the username passed to getUserDownloadStats.

By default, the stats are sorted by their average daily downloads (descending). That should give you an idea of the most "popular" package of a given user relative to how long that package has been around.

You can use it with npx like so:

@NickNaso
NickNaso / README.md
Created September 10, 2020 10:38 — forked from nichtich/README.md
How to automatically deploy from GitHub

Deploy your site with git

This gist assumes:

  • you have an online remote repository (github / bitbucket etc.)
  • you have a local git repo
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by Apache
  • the Apache user is named www-data (may be apache on other systems)
@NickNaso
NickNaso / cpp1.yml
Created June 3, 2020 23:57
Example of Github actions for cpp project
ame: CMake Build Matrix
on: [push, pull_request]
env:
CMAKE_VERSION: 3.16.2
NINJA_VERSION: 1.9.0
BUILD_TYPE: Release
CCACHE_VERSION: 3.7.7
@NickNaso
NickNaso / cpp.yml
Created June 3, 2020 23:55
Example of Github action for C++ rpoject
# This is a basic workflow to help you get started with Actions
# workflow - цепочка действий
# Имя процесса Билдится на всех типах 📦 🐍
name: CMake Build Matrix
# Controls when the action will run. Triggers the workflow on push
on:
push:
pull_request:
release:
@NickNaso
NickNaso / get-symbol-from-current-process.h
Created May 10, 2020 15:06
C function to get a symbol from the current process
#ifndef _GET_SYMBOL_FROM_CURRENT_PROCESS_H
#define _GET_SYMBOL_FROM_CURRENT_PROCESS_H
#include <assert.h>
#ifdef _WIN32
#include <windows.h>
#else
#include <dlfcn.h>
#endif