Skip to content

Instantly share code, notes, and snippets.

View raftheunis87's full-sized avatar

Raf Theunis raftheunis87

View GitHub Profile
@raftheunis87
raftheunis87 / eslint-prettier-typescript
Last active January 26, 2023 16:55
ESLint with airbnb and Prettier for Typescript
1) install dependencies:
yarn add @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-airbnb-typescript eslint-config-prettier eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks prettier --dev
2) create .eslintrc.js file:
```
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
extends: [
@raftheunis87
raftheunis87 / contact.js
Created October 8, 2019 04:40
contact.js
$(() => {
$('#contactForm input,#contactForm textarea').jqBootstrapValidation({
preventSubmit: true,
submitError() {
// additional error messages or events
},
submitSuccess($form, event) {
event.preventDefault(); // prevent default submit behaviour
// get values from FORM
const name = $('input#name').val();
@raftheunis87
raftheunis87 / contact_form.php
Created October 8, 2019 04:37
contact_form.php
<?php
// Check for empty fields
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['message']) ||
empty($_POST['response']) ||
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
{
echo "No arguments Provided!";
return false;
@raftheunis87
raftheunis87 / hyperjs.md
Last active December 22, 2024 15:37
Hyper.js + Hyper.js Plugins + ZSH + Starship + Fira Code + Dark Theme - (macOS)

Hyper.js

@raftheunis87
raftheunis87 / tslint-vscode-airbnb.md
Last active March 2, 2021 15:17
Setting up TSLint on VS Code with Airbnb TypeScript Style Guide
  1. cd coding-directory
  2. npm init -y
  3. npm install --save-dev tslint tslint-config-airbnb
  4. Create tslint.json file with following content:
{
    "extends": "tslint-config-airbnb"
}
  1. Install TSLint plugin in Visual Studio Code
@raftheunis87
raftheunis87 / creating-a-self-signed-ssl-certificate.md
Created May 30, 2018 13:59
Creating a Self-Signed SSL Certificate
  1. openssl genrsa -des3 -passout pass:<your_pass_key_here> -out server.pass.key 2048
  2. openssl rsa -passin pass:<your_pass_key_here> -in server.pass.key -out server.key
  3. openssl req -new -key server.key -out server.csr
  4. openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt
@raftheunis87
raftheunis87 / eslint-vscode-airbnb.md
Last active June 14, 2024 14:48
Setting up ESLint on VS Code with Airbnb JavaScript Style Guide
  1. cd coding-directory
  2. npm init -y
  3. npm install --save-dev --save-exact eslint eslint-config-airbnb-base eslint-plugin-import
  4. Create .eslintrc file with following content:
{
  "extends": "airbnb-base",
  "env": {
    "browser": true,
 "node": true
@raftheunis87
raftheunis87 / java8macOSbrew.md
Last active April 27, 2018 13:06
Install Java 8 on macOS with brew cask

Install Java 8 on macOS with brew cask

  1. open Terminal/iTerm
  2. install brew: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. install homebrew-cask: brew tap caskroom/cask
  4. tap versions: brew tap caskroom/versions
  5. install Java 8: brew cask install java8
@raftheunis87
raftheunis87 / encoding-video.md
Created April 11, 2018 06:44 — forked from glen-cheney/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@raftheunis87
raftheunis87 / android_instructions_27.md
Last active March 2, 2018 13:47 — forked from agrcrobles/android_instructions_29.md
Setup Android Development Environment on a Mac

Prerequisites:

  • XCode is installed (via the App Store)
  • XCode Command Line Tools are installed (xcode-select --install in Terminal/iTerm)
  • Java

Install Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Make sure the doctor is happy (do what it tells you):