Skip to content

Instantly share code, notes, and snippets.

— Step 1: Create CSV table with dummy header column as first row.
CREATE TABLE table_csv_export_data
ROW FORMAT DELIMITED FIELDS TERMINATED BY ‘,’
LINES TERMINATED BY ‘\n’
STORED as textfile
AS
select
‘id’ as id
,’first_name’ as first_name
@sofyan-ahmad
sofyan-ahmad / 01-yarn.config
Created October 21, 2018 07:45
AWS Elasticbeasnstalk NodeJS 10.x and Yarn
# file: .ebextensions/01-yarn.config
commands:
01_create_npmrc:
# run this command from /tmp directory
cwd: /tmp
command: 'sudo touch /tmp/.npmrc \
| sudo echo \
"//registry.npmjs.org/:_authToken=$(sudo /opt/elasticbeanstalk/bin/get-config environment -k NPM_TOKEN)" \
| sudo tee /tmp/.npmrc'
@sofyan-ahmad
sofyan-ahmad / poi.config.ts
Created July 18, 2018 11:26
poi.config.ts sample !!FOR EXPERIMENTAL ONLY!!
import { Options } from 'poi';
import * as VueLoaderPlugin from 'vue-loader/lib/plugin';
const options: Options = {
entry: './src/main.ts',
html: {
title: 'Vuex with TypeScript example',
template: './index.html',
},
homepage: '.',
var path = require('path');
var lodash = require('lodash');
var app = require(path.resolve(__dirname, '../server/server'));
var models = require(path.resolve(
__dirname,
'../server/model-config.local.js'
));
function autoMigrateAll(dataSourceName) {
import { action, observable } from 'mobx';
class LoginStore {
@observable public email = '';
@observable public password = '';
@observable public isValid = false;
@observable public emailError : string | undefined = '';
@observable public passwordError : string | undefined = '';
@action
Minimum eight characters, at least one letter and one number:
"^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$"
Minimum eight characters, at least one letter, one number and one special character:
"^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$"
Minimum eight characters, at least one uppercase letter, one lowercase letter and one number:
"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$"
Minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character:
ls | awk '$0="import "$0" from \""$0"\";"'
# Replace string starts with new line with content inside dquote
\n.*aria-label=".*"
# Settiing your ubuntu development machine
1. Install Consul: https://gist.github.com/SofyanHadiA/b5949dfa72f5c0c8348e6805ceef1b7c
2. Install Protobuf: https://gist.github.com/SofyanHadiA/37787e5ed098c97919b8c593f0ec44d8
3. Install Go Swagger: https://gist.github.com/SofyanHadiA/600a3033421b44af0cecceb3ea58e23e
4. Install Go Kubernetes: https://gist.github.com/SofyanHadiA/21fa625b1ea5e6e66c8f949e74081cc2
Have fun with: https://github.com/micro/go-micro
# Install go kubernetes
# make sure you have godep: go get github.com/tools/godep
# make sure your $GOROOT/bin is in the right $PATH
# export PATH="$GOPATH/bin:$PATH"
# Just to make sure
# export PATH="$GOROOT/bin:$PATH"
go get -u k8s.io/kubernetes
cd $GOPATH/src/k8s.io/kubernetes