Skip to content

Instantly share code, notes, and snippets.

View Parables's full-sized avatar
💭
Contributing to Open Source projects... #GivingBack2éCommunity

Parables Boltnoel Parables

💭
Contributing to Open Source projects... #GivingBack2éCommunity
  • Ghana
View GitHub Profile
@Parables
Parables / updateVSCodeExtensionsInstallationScript.sh
Created June 26, 2021 01:30 — forked from gingerpaledale/updateVSCodeExtensionsInstallationScript.sh
Export Installed Visual Studio Code Extensions in a Form of Installation Script
#!/usr/bin/env zsh
#
# This script generates and writes to file another bash-script (output_script)
# that implements "vscodeInstallExtensions" function which installs all
# Visual Studio Code extensions that were originally installed on your machine
# at the moment of generation output_script by running
# "vscodeUpdateExtensionsInstallationScript" function that is implemented here below.
#
# # How to use
#
@Parables
Parables / .vscode--extensions.json
Last active October 15, 2024 14:35
VS Code Laravel Recommended Extensions
{
"recommendations": [
"aaron-bond.better-comments",
"adpyke.codesnap",
"adrianwilczynski.alpine-js-intellisense",
"ahinkle.laravel-model-snippets",
"ahmadawais.shades-of-purple",
"aibnuhibban.laravel-smart-command",
"alefragnani.project-manager",
"amiralizadeh9480.laravel-extra-intellisense",
@Parables
Parables / fish_alias.md
Created June 12, 2021 03:26 — forked from tikolakin/fish_alias.md
Create alias in Fish shell and save this as a permanent function

Directly from CLI

alias x='exit'
funcsave x

or create a file in

~/.config/fish/functions 

with name

#Option 1
set -U fish_user_paths /usr/local/bin $fish_user_paths
#option 2
set PATH $PATH /usr/local/bin
export PATH
function ll
ls -lh $argv
end
@Parables
Parables / monads.ts
Created June 5, 2021 09:14
Monads using null. Clever tricky by Nathan Franck http://disq.us/p/266tez0
function getSupervisorName(enteredId: string | null) {
let employee, supervisor;
if (null != enteredId &&
null != (employee = repository.findById(parseInt(enteredId))) &&
null != employee.supervisorId &&
null != (supervisor = repository.findById(employee.supervisorId)))
return supervisor.name;
}
@Parables
Parables / monads.ts
Created June 5, 2021 09:14
Monads using null. Clever tricky by Nathan Franck http://disq.us/p/266tez0
function getSupervisorName(enteredId: string | null) {
let employee, supervisor;
if (null != enteredId &&
null != (employee = repository.findById(parseInt(enteredId))) &&
null != employee.supervisorId &&
null != (supervisor = repository.findById(employee.supervisorId)))
return supervisor.name;
}
@Parables
Parables / nested_value_henlpers.ts
Last active June 4, 2021 06:13
Set a deeply nested value or get the value of a deeply nested key using dot-separated-string path. E.g: 'some.deeply.nested.key'
let data: Record<string, any> = { initial: "something" }
let key = "root.field.subField"
const setNestedValue = (obj: Record<string, any>, path: string, value) => {
return path.split(".")
.reduce((acc, cur, index, arr) => index === arr.length - 1 ? acc[cur] = value : acc[cur] = {}, obj)
}
const getNestedValue = (obj: Record<string, any>, path: string, defaultValue?: any) =>
@Parables
Parables / fullstack-setup.md
Created February 12, 2021 05:56
Ulitmate Ubuntu FullStack Development Setup right after installation

How to set up for development on Ubuntu based machine using Elementary OS

@Parables
Parables / New Dyna Form.ts
Last active June 4, 2021 06:25
This builds a Form using Flexbox where fields are arranged in a row, many rows make a section, many sections makes up the form
interface IForm {
id: string
sections: any[]
classNames?: string
store?: any
validator?: any
}
export type FieldType = "text" | "email" | "password" | "tel" | "date" | "time" | "number" |
@Parables
Parables / App.svelte
Last active June 5, 2021 20:56
This is the test version of the source code used to make Dynamic Form Building using Classes
<script>
import FormBuilder from './FormBuilder.svelte'
import { Form } from './Form'
let form = new Form({id: "Test Form", sections: []})
let title ="New Section"
function addSection(){
form= form.addSection({title: title, rows:[]});
form.print()
}