Skip to content

Instantly share code, notes, and snippets.

@oelbaga
oelbaga / 01 - Setup Nextjs site on Ubuntu Server - Terminal commands
Last active May 18, 2024 09:41
Setup NextJS app on Digital Ocean Ubuntu server Full Terminal Commands Step by Step
#Setup NextJS on Ubuntu server (Digital Ocean, EC2,...) Terminal Commands
#based on my YouTube video
#Recommended: An ubuntu server with at least 2 GB memory to handle npm run build
#login to server
ssh root@ip_address
#Upgrade Server - may take a few minutes
sudo apt update
sudo apt upgrade
@iam-hussain
iam-hussain / default HTTP
Last active May 17, 2024 19:09
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;
@felipessalvatore
felipessalvatore / gradient_descent.py
Last active July 6, 2022 05:35
Plotting a 3d image of gradient descent in Python
#code adapted from http://tillbergmann.com/blog/python-gradient-descent.html
%matplotlib inline
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from scipy import stats
from sklearn.datasets.samples_generator import make_regression
/*
* SEP firmware split tool
*
* Copyright (c) 2017 xerub
*/
#include <fcntl.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@shadyvb
shadyvb / .gitconfig
Created May 24, 2016 15:13
Git Aliases
[alias]
# Merge the current branch to another one, created back when I needed to merge into three branches before issuing a PR
merge-to = "!f() { git checkout $1 && git merge $2 && git checkout $2; }; f"
# Commit shorthand family:
c = commit
cm = commit -m
cam = commit -am
camp = "!f() { git commit -am \"$1\"; git push; }; f"
ca = commit -a
@Chandler
Chandler / slack_history.py
Last active March 26, 2024 14:35
Download Slack Channel/PrivateChannel/DirectMessage History
print("UPDATE AUG 2023: this script is beyond old and broken")
print("You may find interesting and more up to date resources in the comments of the gist")
exit()
from slacker import Slacker
import json
import argparse
import os
# This script finds all channels, private channels and direct messages
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@sigrlami
sigrlami / ab.md
Last active March 4, 2022 14:40
List of companies using Haskell https://haskellcosm.com

WARNING This list outdated, for the up to date version visit https://haskellcosm.com

List of companies that use Haskell in Production

Types of work:

  • RD - research&development
  • PR - product
  • IP - in-house product
  • CO - consulting
@Kartones
Kartones / postgres-cheatsheet.md
Last active May 24, 2024 09:21
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)