Skip to content

Instantly share code, notes, and snippets.

View AnechaS's full-sized avatar
😀
Hello

Anecha Kuekharem AnechaS

😀
Hello
  • True Digital Group
  • Thailand
  • 19:35 (UTC +07:00)
View GitHub Profile
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active April 24, 2024 10:14
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@yidas
yidas / js-nl2br-br2nl.md
Last active September 29, 2023 05:26
JavaScript nl2br & br2nl functions

JavaScript nl2br & br2nl functions

The exchange of new line & br HTML tag could refer to PHP - nl2br() function, which uses to inserts HTML line breaks before all newlines in a string.

These JavaScript functions consider whether to use insert or replace to handle the swap.

nl2br

@bgauduch
bgauduch / multiple-repository-and-identities-git-configuration.md
Last active April 25, 2024 12:45
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
@xameeramir
xameeramir / default nginx configuration file
Last active April 15, 2024 09:51
The default nginx configuration file inside /etc/nginx/sites-available/default
# Author: Zameer Ansari
# 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.
#
@kocisov
kocisov / next_nginx.md
Last active April 10, 2024 14:27
How to setup next.js app on nginx with letsencrypt
@sikofitt
sikofitt / composer.json
Last active July 2, 2021 19:51
Guzzle promise example and Pool example
{
"name": "sikofitt/guzzle-example",
"description": "Guzzle Example",
"type": "project",
"require": {
"php":">=5.6",
"guzzlehttp/guzzle": "^6.2"
},
"require-dev": {
"symfony/var-dumper": "^3.2",
@wzed
wzed / guzzle_pool_example.php
Created February 8, 2017 08:57
GuzzleHttp\Pool example: identifying responses to concurrent async requests
<?php
/*
* Using a key => value pair with the yield keyword is
* the cleanest method I could find to add identifiers or tags
* to asynchronous concurrent requests in Guzzle,
* so you can identify which response is from which request!
*/
$client = new GuzzleHttp\Client(['base_uri' => 'http://httpbin.org']);
@andreibosco
andreibosco / creative-cloud-disable.md
Last active January 3, 2024 02:37
disable creative cloud startup on mac
@tomysmile
tomysmile / mac-setup-redis.md
Last active March 18, 2024 22:12
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@illepic
illepic / private-github-release-download.sh
Last active January 2, 2024 09:43
Download the latest release binary from a private GitHub repo. (i.e. a .tar.gz that you have manually uploaded in a GitHub release). Update OAUTH_TOKEN, OWNER, REPO, FILE_NAME with your custom values.
#!/usr/bin/env bash
# Authorize to GitHub to get the latest release tar.gz
# Requires: oauth token, https://help.github.com/articles/creating-an-access-token-for-command-line-use/
# Requires: jq package to parse json
# Your oauth token goes here, see link above
OAUTH_TOKEN="34k234lk234lk2j3lk4j2l3k4j2kj3lk"
# Repo owner (user id)
OWNER="your-user-name"