Skip to content

Instantly share code, notes, and snippets.

View nicolasguzca's full-sized avatar
Learning, improving, growing, helping

Nick nicolasguzca

Learning, improving, growing, helping
View GitHub Profile
cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin.git

Please read the new and updated version.

Sendy

Sendy is a self hosted email newsletter application that lets you send trackable emails via Amazon Simple Email Service (SES).

Heroku

You can deploy Sendy on Heroku using the following instructions (I assume you've already installed the heroku toolbelt).

package main
import (
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
_ "github.com/mattn/go-sqlite3"
)
type Users struct {
Id int `gorm:"AUTO_INCREMENT" form:"id" json:"id"`
@nicolasguzca
nicolasguzca / class.database.php
Created August 14, 2019 14:57 — forked from jonashansen229/class.database.php
PHP OOP Database class using MySQLI and Singleton pattern. Only one instance of the class will be made, this requires less memory.
<?php
/*
* Mysql database class - only one connection alowed
*/
class Database {
private $_connection;
private static $_instance; //The single instance
private $_host = "HOSTt";
private $_username = "USERNAME";
private $_password = "PASSWORd";
@nicolasguzca
nicolasguzca / CaptionAmazonService.php
Created September 6, 2019 20:22 — forked from mwleinad/CaptionAmazonService.php
For those that are looking for a way to create an srt or vtt file from Amazon Transcribe Service
<?php
//Not everything will work out of the box for you, as this is just for our application.
//Framework Laravel
namespace Modules\Caption\Services;
//https://github.com/captioning/captioning
use Captioning\Format\WebvttFile;
use ilos\Models\Caption\CaptionRequest;
use Exception;
@nicolasguzca
nicolasguzca / floating-ip-gateway.sh
Last active August 18, 2021 15:24 — forked from sparkcodeuk/floating-ip-gateway.sh
Digital Ocean floating IP gateway script (force droplet to use the assigned floating IP for outbound traffic as well as inbound traffic)
#!/bin/bash
# Force outbound traffic through the attached floating IP
NET_INT="eth0"
CURL_TIMEOUT=3
echo -n "Setting floating IP as the default gateway: "
# Check there's a floating IP attached to this droplet
if [ "$(curl -s --connect-timeout $CURL_TIMEOUT http://169.254.169.254/metadata/v1/floating_ip/ipv4/active)" != "true" ]; then
@nicolasguzca
nicolasguzca / vesta-user-fix-permission.sh
Created March 18, 2022 04:13 — forked from 0x00dec0de/vesta-user-fix-permission.sh
Fix user permissions to vesta control panel
#!/bin/bash
cd /home/
for i in `ls | grep -v 'lost+found'`; do
if id "$i" &>/dev/null ; then
chattr -i /home/$i/conf
chown -R ${i}:${i} $i
chown root:root /home/$i/conf
chown root:root /home/$i/conf/*
chown root:bind /home/$i/conf/dns/* &>/dev/null
chown Debian-exim:mail /home/$i/conf/mail/* &>/dev/null