Skip to content

Instantly share code, notes, and snippets.

View danteay's full-sized avatar
:atom:
Working from home

Eduardo Aguilar Yépez danteay

:atom:
Working from home
View GitHub Profile
package main
import (
"fmt"
"io"
"os"
)
var path = "/Users/novalagung/Documents/temp/test.txt"
@danteay
danteay / put-object-on-aws-s3.php
Created February 6, 2019 06:11 — forked from keithweaver/put-object-on-aws-s3.php
Upload an image/object to an AWS S3 Bucket using PHP
<?php
// Installed the need packages with Composer by running:
// $ composer require aws/aws-sdk-php
$filePath = "https://example.com/test.png";
require 'vendor/autoload.php';
$bucketName = 'YOUR_BUCKET_NAME';
$filePath = './YOUR_FILE_NAME.png';
@danteay
danteay / node_nginx_ssl.md
Created November 24, 2020 08:55 — forked from bradtraversy/node_nginx_ssl.md
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

@danteay
danteay / boto_sns.py
Created January 16, 2021 00:51 — forked from gjedeer/boto_sns.py
How to send a push notification directly to device using Python, Boto and SNS
import boto
import boto.exception
import boto.sns
import pprint
import re
def send_push(device_id, body):
region = [r for r in boto.sns.regions() if r.name==u'eu-west-1'][0]
sns = boto.sns.SNSConnection(