Skip to content

Instantly share code, notes, and snippets.

View devacto's full-sized avatar

Victor Wibisono devacto

View GitHub Profile
@devacto
devacto / sample-aws-ssl-ingress-nginx-external.yaml
Last active February 2, 2023 11:58
sample-aws-ssl-ingress-nginx-external.yaml
---
apiVersion: v1
kind: Namespace
metadata:
labels:
app.kubernetes.io/instance: ingress-nginx
app.kubernetes.io/name: ingress-nginx
name: ingress-nginx
---
apiVersion: v1
@devacto
devacto / GH-CF-strict-SSL-w-CDN.md
Created March 18, 2021 15:15 — forked from zbeekman/GH-CF-strict-SSL-w-CDN.md
Setting up GH-pages with custom domain, strict (end-to-end) SSL with CloudFlare DNS & CDN

Custom domains, GH-pages, Cloudflare and strict SSL end-to-end encryption

Why I wrote this

Before Github supported SSL encryption for github pages sites, many people were using CloudFlare (CF) as their DNS provider and CDN proxy. CF allowed users to enable SSL encryption from the CDN end points/proxies to the end user. This was great and it allowed visitors to your website to connect with a secure connection between their browser and the cloudflare CDN box that was serving your content. However, with this setup one (significant) link in the chain remained unencrypted and

## Bank Mandiri KSQL POT
### Download the MySQL Driver
`curl -k -SL "https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.17.tar.gz" | tar -xzf - -C /Users/victor/desktop/mandiri-ksql-pot/mysql-driver --strip-components=1 mysql-connector-java-8.0.17/mysql-connector-java-8.0.17-bin.jar`
### Deploy Confluent Platform using Docker
`docker-compose up --build`
### Deploy Customer Source Kafka Connector
`curl --silent --request POST http://localhost:8083/connectors/ --header 'Content-Type: application/json' --data @source-connector-configs/mysql_customer_source_connector_config.json`
@devacto
devacto / cli.py
Last active October 30, 2020 10:02
import logging
import click
import os
import posixpath
from mlflow.models import Model
from mlflow.models.flavor_backend_registry import get_flavor_backend
from mlflow.tracking.artifact_utils import _download_artifact_from_uri
from mlflow.utils.file_utils import TempDir
from mlflow.utils import cli_args
@devacto
devacto / build.gradle
Created July 1, 2014 07:35
Example Gradle build file for use with Dropwizard.
apply plugin: 'java'
apply plugin: 'gradle-one-jar'
apply plugin: 'application'
// Use Java 8 by default
sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '1.0'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
@devacto
devacto / eclipse_solarized_theme.epf
Created November 15, 2013 00:13
The Eclipse Solarized theme from Eclipse Themes have a defect in that find occurrence are not properly highlighted. This version fixed it.
file_export_version=3.0
/instance/org.codehaus.groovy.eclipse.ui/groovy.editor.groovyDoc.keyword.enabled=true
/instance/org.codehaus.groovy.eclipse.ui/groovy.editor.groovyDoc.link.enabled=true
/instance/org.codehaus.groovy.eclipse.ui/groovy.editor.groovyDoc.tag.enabled=true
/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.SelectionForeground.SystemDefault=false
/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.SelectionBackground.SystemDefault=false
/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.Background.SystemDefault=false
/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.Foreground.SystemDefault=false
/instance/org.epic.perleditor/AbstractTextEditor.Color.Background.SystemDefault=false
/instance/org.epic.perleditor/AbstractTextEditor.Color.Foreground.SystemDefault=false
@devacto
devacto / regex.js
Created November 13, 2013 05:07
Example of using regex with Javascript.
// Validate IMEI numbers.
$('#RequestProofOfPurchaseFloorStockForm').find('.imei').each(function() {
var pattern = /^(?!\b(.)\1+\b)\d{15}$/gi;
if(pattern.test($(this).val()) == false) {
validate = false;
$(this).addClass('err');
$(this).parent().find('label').addClass('err');
}
});
@devacto
devacto / add_padded_identifier.sql
Created November 6, 2013 03:49
Add padded identifier from store codes.
CONCAT('DS', LPAD(store_code, 4, 0));
@devacto
devacto / uppercase_first_letter.sql
Created November 6, 2013 03:45
MySQL function to change the first letter into upper case.
CREATE FUNCTION ucfirst(x varchar(255)) returns varchar(255)
return concat( upper(substring(x,1,1)),lower(substring(x,2)) );
@devacto
devacto / sub_string_count.sql
Created November 6, 2013 03:41
Count the number of sub-strings separated by a specified delimiter.
CREATE FUNCTION substrCount(x varchar(255), delim varchar(12)) returns int
return (length(x)-length(REPLACE(x, delim, '')))/length(delim);