Skip to content

Instantly share code, notes, and snippets.

View ilhamsabir's full-sized avatar
📫

ilhamsabir ilhamsabir

📫
View GitHub Profile
<?php
namespace Botble\Base\Supports;
use Botble\Base\Events\LicenseActivated;
use Botble\Base\Events\LicenseActivating;
use Botble\Base\Events\LicenseDeactivated;
use Botble\Base\Events\LicenseDeactivating;
use Botble\Base\Events\LicenseInvalid;
use Botble\Base\Events\LicenseRevoked;
@ilhamsabir
ilhamsabir / buckets.tf
Created January 8, 2022 13:42 — forked from nagelflorian/buckets.tf
Terraform config for static website hosting on AWS
# AWS S3 bucket for static hosting
resource "aws_s3_bucket" "website" {
bucket = "${var.website_bucket_name}"
acl = "public-read"
tags {
Name = "Website"
Environment = "production"
}
@ilhamsabir
ilhamsabir / node_nginx_ssl.md
Created September 29, 2020 02:56 — 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

@ilhamsabir
ilhamsabir / fb-upload-image.js
Created September 18, 2020 14:23 — forked from jt0in3e/fb-upload-image.js
Facebook Messenger APIs: upload and send image to messenger with Node.js
/*
Would be updated
*/
"use strict"
const request = require("request");
const fs = require("fs");
const image = fs.createReadStream("path/to/image.jpg ")
//run from terminal /node app.js/ and get variables from command line
@ilhamsabir
ilhamsabir / FacebookLogin.vue
Created August 19, 2020 17:12 — forked from kilonzi/FacebookLogin.vue
A Facebook Login button Single File Component done in VueJS
<template>
<div>
<button class="button" @click="logInWithFacebook"> Login with Facebook</button>
</div>
</template>
<script>
export default {
name:"facebookLogin",
methods: {
// required variable
const timezone = 'Asia/Jakarta'
const dateFormat = moment.utc(date).tz(timezone)
const createdAt = new Date(dateFormat).getTime()
const converDeadlineDate = new Date(createdAt + (60 * 60 * 24 * 1000))
const deadline = new Date(converDeadlineDate).getTime()
// deadline info
const deadLineDays = moment.utc(converDeadlineDate).tz(timezone).format('dddd')
const deadLineDate = moment.utc(converDeadlineDate).tz(timezone).format('DD MMMM YYYY')
@ilhamsabir
ilhamsabir / GoogleDriveServiceProvider.php
Created February 18, 2019 03:30 — forked from sergomet/GoogleDriveServiceProvider.php
Setup a Laravel Storage driver with Google Drive API
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class GoogleDriveServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
@ilhamsabir
ilhamsabir / Rupiah.as
Created November 6, 2018 14:38 — forked from faisalman/Rupiah.as
Konversi Angka ke format Rupiah & vice versa (C#, PHP, JavaScript, ActionScript 3.0)
package
{
/**
* ActionScript 3.0 Code Snippet
* Convert Number to Rupiah & vice versa
* https://gist.github.com/845309
*
* Copyright 2011-2012, Faisalman
* Licensed under The MIT License
* http://www.opensource.org/licenses/mit-license
$(document).ready(function() {
function detectmob() {
if( navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i)