Skip to content

Instantly share code, notes, and snippets.

View caco0516's full-sized avatar

Carlos Castillo Oporta caco0516

View GitHub Profile
@caco0516
caco0516 / README.md
Created November 28, 2023 06:08 — forked from Restuta/README.md
How to get IP Ranges for Heroku

Ip Ranges

Sometimes it's useful to know what IP ranges our servers are operating in. Since we run on Heroku, it's a little complicated. However, Heroku runs on AWS, which has this page dedicated to IP Ranges by Region.

Heroku recommends using this to identify which region are bing in use. If dynos are run in common spaces in US region, we can look up information about this region using Heroku's API:

using httpie:

 http https://api.heroku.com/regions/us "Accept:application/vnd.heroku+json; version=3"
@caco0516
caco0516 / install-kubectl.sh
Created July 2, 2023 20:27
Install Kubectl on Linux Mint (Debian)
mkdir $HOME/.kube
touch $HOME/.kube/config
sudo apt-get update
sudo apt-get install -y ca-certificates curl
sudo apt-get install -y apt-transport-https
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-archive-keyring.gpg
@caco0516
caco0516 / MailJet Node Send.js
Created February 3, 2017 13:35
A little example of how to send emails with MailJet Node.js module.
// This calls sends an email to one recipient.
var mailjet = require ('node-mailjet')
.connect(process.env.MJ_APIKEY_PUBLIC, process.env.MJ_APIKEY_PRIVATE)
var request = mailjet
.post("send")
.request({
"FromEmail": "caco0516@gmail.com",
"FromName": "noreply@growposapp.com",
"Subject": "Bienvenido a Grow POS",
"MJ-TemplateID": "103446",
@caco0516
caco0516 / ChangeName.cs
Created May 12, 2016 20:26
Change tables names of a new Web App Project in Visual Studio
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public ApplicationDbContext()
: base("DefaultConnection", throwIfV1Schema: false)
{
}
public static ApplicationDbContext Create()
{
return new ApplicationDbContext();