Skip to content

Instantly share code, notes, and snippets.

View kgmorales's full-sized avatar
:octocat:

Kevin Morales kgmorales

:octocat:
View GitHub Profile
@kgmorales
kgmorales / quokka-snippets.json
Last active December 1, 2021 17:44
Quokka keybindings.
// extension should be:
// "quokka-snippets.code-snippets"
// is json for gist formatting.
{
"Quokka Expression": {
"scope": "javascript,typescript",
"prefix": "/}",
"body": "/*? $1$ */",
"description": "Log expression result"
@kgmorales
kgmorales / button.component.ts
Last active April 13, 2021 16:03
Button.component.ts
import { Component, Input, Output, EventEmitter, HostListener, OnInit, OnDestroy, OnChanges } from '@angular/core';
import { Subject } from 'rxjs';
import { SiteDataService } from '../../core/services/site-data.service';
import { takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-button',
template: `<button *ngIf="value" [id]="buttonID ? buttonID : ''" [class]="buildBtnClasses(this.type, this.size, this.width, this.icon, this.additionalButtonClass)" [disabled]="loading || disabled" role="button">
<span class="btn-label" [style.visibility]="loading ? 'hidden':'visible'">
<app-dictionary-text [englishText]="value"></app-dictionary-text>
@kgmorales
kgmorales / minimumValue.js
Last active October 5, 2020 18:09
Find the minimum value in that array in O(n) or less.
//Given an array that was once sorted in ascending order is rotated at some pivot unknown to you beforehand (so [0,2,4,7,9] //might become [7,9,0,2,4], for example). Find the minimum value in that array in O(n) or less.
const arr = [7, 9, 0, 2, 4];
const getMinValue = (arr) => {
let left = 1;
let right = arr.length - 1;
let min = arr[0];
while (left < right) {
@kgmorales
kgmorales / _mixins.scss
Created October 17, 2016 23:26
Bootstrap media query mixin
//media queries breakpoints
@mixin bp($class) {
@if $class == xs {
@media (max-width: 767px) { @content; }
}
@else if $class == sm {
@media (min-width: 768px) { @content; }
}