Skip to content

Instantly share code, notes, and snippets.

View vorpal56's full-sized avatar
🦀

Anthony Sukadil vorpal56

🦀
View GitHub Profile
@vorpal56
vorpal56 / example.xlsm
Created January 16, 2021 02:55
Dependants and Precendents of Excel VBA
Function fullAddress(inCell As Range) As String
fullAddress = Split(inCell.Address(External:=True), "]")(1)
End Function
Function findDepend(ByVal inRange As Range) As String
Dim sheetIdx As Integer
sheetIdx = Sheets(inRange.Parent.Name).Index
If sheetIdx = Worksheets.Count Then 'vba bug workaround
@vorpal56
vorpal56 / Hadoop Windows Installation and Running MapReduce Jobs.md
Last active May 1, 2024 20:22
Hadoop 3.2.1 Windows 10 Installation step by step guide and running MapReduce Jobs

Setup Hadoop on Windows 10 machines

Consolidated instructions on how to setup and run Hadoop on Windows 10 machines. This is exactly written from Hadoop 3.2.1 Installation on Windows 10 step by step guide. Big thanks to Raymond, the original writer. If you already have Hadoop installed and configured on your machine, you can go to the Running MapReduce Jobs section.

Required tools

  1. Java JDK - used to run the Hadoop since it's built using Java
  2. 7Zip or WinRAR - unzip Hadoop binary package; anything that unzips tar.gz
  3. CMD or Powershell - used to test environment variables and run Hadoop

Step 1 - Download and extract Hadoop

@vorpal56
vorpal56 / aws-emr.sh
Last active November 24, 2020 18:55
Run Hadoop MapReduce Job on AWS EMR
sudo chmod 400 <key_name>.pem
ssh -i <key_name>.pem hadoop@<ec2-ip>
sudo yum install git-core
git clone <repo>
cd <repo>
sudo mkdir compiled
sudo javac <some_directory>/*.java -cp `hadoop classpath` -d compiled/
cd compiled
sudo jar -cvf <application_name>.jar ./<some_directory>/*.class
hadoop fs -mkdir /input
@vorpal56
vorpal56 / contact.component.css
Last active September 30, 2020 14:07
Contact form without a server using Angular - Contact Component CSS
.hidden {
display: none
}
.visible {
display: block
}
.center-text {
text-align: center
}
form.contact {
@vorpal56
vorpal56 / contact.component.html
Last active September 30, 2020 14:30
Contact form without a server using Angular - contact.component.html with Material
<form class="contact" [formGroup]="form" method="post" (ngSubmit)="onSubmit()">
<mat-form-field>
<mat-label>Name</mat-label>
<input matInput [formControl]="name" required>
<mat-error *ngIf="name.invalid">Please enter your name</mat-error>
</mat-form-field>
<mat-form-field>
<mat-label>Email</mat-label>
<input matInput [formControl]="email" placeholder="email@example.com" required>
<mat-error *ngIf="email.invalid">Please enter a valid email</mat-error>
@vorpal56
vorpal56 / contact.component.html
Last active September 30, 2020 14:31
Contact form without a server using Angular - contact.component.html without Material
<form class="contact" [formGroup]="form" method="post" (ngSubmit)="onSubmit()">
Name
<input [formControl]="name" required>
Email
<input [formControl]="email" placeholder="email@example.com" required>
Message
<textarea [formControl]="message" maxlength="256" placeholder="I'm interested in..." required></textarea>
<button [disabled]="isLoading" class="submit" type="submit">Submit</button>
<input [formControl]="honeypot" class="hidden" type="text" />
<div [ngClass]="!submitted? 'hidden' : 'visible'" class="center-text">
@vorpal56
vorpal56 / app.module.ts
Created September 29, 2020 22:44
Contact form without a server using Angular - app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { ContactComponent } from './contact/contact.component';
import { ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from "@angular/common/http";
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { MatInputModule } from "@angular/material/input";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
@vorpal56
vorpal56 / contact.component.ts
Last active September 30, 2020 14:34
Contact form without a server using Angular - contact.component.ts
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, FormControl, Validators } from '@angular/forms';
@Component({
selector: 'app-contact',
templateUrl: './contact.component.html',
styleUrls: ['./contact.component.scss']
})
export class ContactComponent implements OnInit {