Skip to content

Instantly share code, notes, and snippets.

View alvinmespejo's full-sized avatar

Alvin Ojepse alvinmespejo

  • Tacloban City, Philippines
View GitHub Profile
@alvinmespejo
alvinmespejo / nginx.conf
Created March 10, 2021 16:41 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@alvinmespejo
alvinmespejo / gist:18e6f1afea7f2b6fcac04850ff70005c
Created August 1, 2020 12:17 — forked from harrisonde/gist:90431ed357cc93e12b51
Deploy Laravel 5 applications on AWS Elastic Beanstalk
# The following script will deploy a Laravel 5 applicaion on AWS Elastic Beanstalk.
# Add to .ebextensions at the root of your application and name your commands file (e.g., commands.config)
# -------------------------------- Commands ------------------------------------
# Use "commands" key to execute commands on the EC2 instance. The commands are
# processed in alphabetical order by name, and they run before the application
# and web server are set up and the application version file is extracted.
# ------------------------------------------------------------------------------
commands:
01updateComposer:
@alvinmespejo
alvinmespejo / slider.html
Created May 15, 2019 12:03
CSS 3 Slider design
<!--https://codepen.io/personable/pen/stpwD-->
<!DOCTYPE html>
<html>
<head>
<title>Slider</title>
<style type="text/css">
body {
padding: 30px;
}
func ReadByObjectIDAndDate(objTypeID, objtypeIDE int64, sDate, eDate string, queryType string, order string, limit int64) ([]SocialStarPostSchedule, error) {
s := []SocialStarPostSchedule{}
// dtFormat := ""
var args []interface{}
query := "SELECT ssps.*"
// query += "DATE_FORMAT(ssps.PostDate, '%u') AS `weekNum`, DATE_FORMAT(ssps.PostDate, '%x') AS `weekYear` "
query += "FROM SocialStarPostSchedule ssps "
query += "INNER JOIN SocialStarSchedule AS sss ON ssps.SocialStarScheduleID = sss.SocialStarScheduleID "
query += "WHERE sss.ObjectID = ? "
@alvinmespejo
alvinmespejo / realtor.go
Created March 3, 2018 01:51
Realtor Preference
package preference
import (
"circlepix/pkg/database"
"strings"
)
func ReadByID(Id int64) (*Preference, error) {
p := Preference{}
err := database.Get(&p, "SELECT * FROM Preference WHERE PrefId = ?", Id)