Skip to content

Instantly share code, notes, and snippets.

@CodeByKwakes
CodeByKwakes / dynamicFormSetUpOld.ts
Last active March 16, 2023 12:01
Pipe Examples #angular
@Input() formDataObj;
pageProps = [];
private oldFormSetup() {
const formDataObj = {};
for (const propName of Object.keys(this.formDataObj)) {
console.log('prop name', propName);
formDataObj[propName] = new FormControl(this.formDataObj[propName]);
console.log('value', formDataObj[propName].value);
this.pageProps.push({
@CodeByKwakes
CodeByKwakes / breakpoint-mixins.scss
Last active April 15, 2022 09:41
scss breakpoint mixins
$screen-xs-min: 425px; // Tiny phones
$screen-sm-min: 576px; // Small tablets and large smartphones (landscape view)
$screen-md-min: 768px; // Small tablets (portrait view)
$screen-lg-min: 992px; // Tablets and small desktops
$screen-xl-min: 1200px; // Large tablets and desktops
// Mixins
// Tiny devices
@mixin xs {
@CodeByKwakes
CodeByKwakes / input.scss
Created October 12, 2020 09:14
Generated by SassMeister.com.
@function hex-to-rgb($hex) {
@return #{red($hex)},#{green($hex)},#{blue($hex)};
// @return red($hex),green($hex),blue($hex);
}
// replace substring with another string
// credits: https://css-tricks.com/snippets/sass/str-replace-function/
@function str-replace($string, $search, $replace: '') {
$index: str-index($string, $search);
@if $index {
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
@CodeByKwakes
CodeByKwakes / input.scss
Last active July 26, 2023 01:00
Generated by SassMeister.com #scss
@use 'sass:math';
@use 'sass:map';
// $values: (50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400, A700);
@function createPalette($color) {
$white: #fff;
$black: #000;
$baseDark: multiply($color, $color);
@CodeByKwakes
CodeByKwakes / app.module.ts
Last active January 26, 2023 03:02
Caching Http Interceptor #angular
import { NgModule } from '@angular/core';
import { httpInterceptorProviders } from './http-interceptors';
import { Cache } from './services/cache';
import { CacheMapService } from './services/cache-map.service';
@NgModule({
providers: [
httpInterceptorProviders,
CacheMapService,
{ provide: Cache, useClass: CacheMapService }
@CodeByKwakes
CodeByKwakes / terminal-commands.sh
Last active March 26, 2023 12:31
Terminal Commands #scripts
# List All Apps Using the Terminal
ls -la /Applications/ > /Users/kwakes/Workspace/___Space___/InstalledAppsTerminal.txt
# ls -la /Applications/ > /Users/[USERNAME]/InstalledApps/InstalledAppsTerminal.txt
# List All APP Files Everywhere Using Terminal
sudo find / -iname '*.app' > /Users/kwakes/Workspace/___Space___/InstalledAppsOnSystemTerminal.txt
# sudo find / -iname '*.app' > /Users/[USERNAME]/InstalledApps/InstalledAppsOnSystemTerminal.txt
# List All Mac App Store Apps Using Terminal
find /Applications -path '*Contents/_MASReceipt/receipt' -maxdepth 4 -print |
@CodeByKwakes
CodeByKwakes / codeswing.json
Last active March 14, 2022 18:15
Material Design Sass Color Palette
{
"scripts": [],
"styles": []
}
@CodeByKwakes
CodeByKwakes / codeswing.json
Last active April 15, 2022 11:11
Pure SCSS Material Palette Generator
{
"scripts": [],
"styles": []
}
{
"scripts": [],
"styles": []
}