Skip to content

Instantly share code, notes, and snippets.

View rayonhunte's full-sized avatar

Rayon Hunte rayonhunte

  • RASH
  • Georgetown Guyana
View GitHub Profile
@rayonhunte
rayonhunte / alltheparse.sh
Last active July 8, 2019 01:16
commando CLI
reqTotal=$(wc -l $1 | awk -F' ' '{print $1}')
post=0
get=0
push=0
put=0
while IFS= read -r line; do
method=$(echo $line | cut -d' ' -f6)
if [ $method == '"POST' ]
then
@rayonhunte
rayonhunte / admin.component.html
Last active February 8, 2020 11:24
Angular6 NGXS, search filter
<div class="container">
<form class="from col-auto" #s="ngForm">
<div class="form-row align-items-center">
<div class="col-auto">
<label class="sr-only" for="inlineFormInput">Name</label>
<input type="text" class="form-control mb-2"
name="username" ngModel placeholder="User Name">
</div>
<div class="col-auto">
<input type="date" class="form-control mb-2" name="date" ngModel>
@rayonhunte
rayonhunte / message.model.ts
Created August 25, 2018 18:55
NGXS toast messages with angular 6
export class Message {
content: string;
style: string;
date: number;
constructor(content, style) {
this.content = content;
this.style = style || 'info';
this.date = new Date().getTime();
@rayonhunte
rayonhunte / IsvalidAccount.cs
Created July 11, 2018 15:39
real-world-aspnet-web-api-services
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Web.Http.Routing;
namespace DeLoachAero.WebApi
{
public class IsValidAccount : IHttpRouteConstraint
{
import { Directive, Renderer2, ElementRef, HostListener, HostBinding, Input } from '@angular/core';
import { MockNgModuleResolver } from '@angular/compiler/testing';
@Directive({
selector: '[appBetterHighlight]'
})
export class BetterHighlightDirective {
@Input() defaultColor = 'transparent';
@Input() highlightColor = 'blue';
@HostBinding('style.backgroundColor') background: string;;
@rayonhunte
rayonhunte / app.component.html
Created June 14, 2018 17:41
angular binding assessment
<div class="container">
<div class="row">
<div class="col-xs-12">
<h3>Bind it!</h3>
<div>
<app-game-control (addNumber)="showCount($event)"></app-game-control>
<div class="row">
<div class="col-xs-6">
<app-even *ngFor="let number of numberCount" [evenNumber]="number"></app-even>
</div>
@rayonhunte
rayonhunte / List.spec.js
Created August 14, 2017 07:33
simple vue unit test
import List from '@/components/List'
import Vue from 'vue'
describe('List.vue', () => {
it('displays items from the list', () => {
// our test goes here
const Constructor = Vue.extend(List)
const ListComponent = new Constructor().$mount()
expect(ListComponent.$el.textContent).to.contain('play games')
})
@rayonhunte
rayonhunte / Controller.php
Created August 12, 2017 23:38
Code Separation and Debugging
<?php
namespace App\Http\Controllers;
use Log;
use Laravel\Lumen\Routing\Controller as BaseController;
class Controller extends BaseController
{