Skip to content

Instantly share code, notes, and snippets.

Avatar

Darin Hensley dman777

View GitHub Profile
View gist:1af3d84c61dddc28c93c14afbfe51c3e
import {Component, NgModule, forwardRef, ViewChild, ChangeDetectorRef, QueryList, ContentChildren, ApplicationRef, SkipSelf} from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import {MatRadioModule, MatRadioGroup, MatRadioButton} from '@angular/material/radio';
import { FormControl, FormGroup, ReactiveFormsModule, NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';
import {ReplaySubject} from 'rxjs';
import {first} from 'rxjs/operators';
@Component({
selector: 'my-radio-group',
@dman777
dman777 / markdown.md
Created Aug 24, 2020 — forked from ShawnClake/markdown.md
Markdown Cheat sheet
View markdown.md
View gist:96759d797017cd59ef63c4aaad8cb7c8
import requests
import sys
HOST='192.168.1.5:9000'
URL='http://{}/api/v1/users/{}/pets'.format(HOST, sys.argv[1])
payload = { 'petname': 'fido', 'username': 'sue' }
print URL
r = requests.post(URL, json=payload)
@dman777
dman777 / gist:138db668efbc1d929118c53dc8b236fc
Last active Jul 2, 2020
architecture for web components
View gist:138db668efbc1d929118c53dc8b236fc

architecture for web components: 

1)  Use the mediator pattern. This is where the parent element mutates and feeds data to the child component. 

The web components should be dumb. This means they do not own data, they only receive data, display data, and give data back.

View gist:5244775277352bebe7c678d0f42b03ed
$ cat /etc/vim/vimrc.local
set visualbell
set nocompatible " be iMproved, required
filetype off " required
filetype plugin indent on " required
" Put your non-Plugin stuff after this line
@dman777
dman777 / findall_elements_deep.js
Created Apr 16, 2018 — forked from ebidel/findall_elements_deep.js
Finds all elements on the page, including those within shadow dom.
View findall_elements_deep.js
/**
* @author ebidel@ (Eric Bidelman)
* License Apache-2.0
*/
/**
* Finds all elements on the page, inclusive of those within shadow roots.
* @param {string=} selector Simple selector to filter the elements by. e.g. 'a', 'div.main'
* @return {!Array<string>} List of anchor hrefs.
*/
View gist:92092fc6813a89367e54ba7a7c2ac9eb
function broadcastSingleClient(eventType, result, httpObject) {
var newTime = new Date().valueOf();
broadcastTimeRemain = newTime - lastBroadcast.time;
broadcastTimeRemain = lastBroadcast.interval - broadcastTimeRemain;
broadcastTimeRemain = Math.round(broadcastTimeRemain/1000)+2;
result.broadcastStamp = broadcastTimeRemain;
result = JSON.stringify(result);
httpObject.write('data: { \"' + eventType + '\":\n');
httpObject.write('data:' + result + '\n');
httpObject.write('data: }' + '\n\n');
View gist:8190497beaf06880000e83901a9a1694
const runSingleCommand = () => {
require(path.join(__dirname, 'gulp/tasks', args[0]));
};
if (args.length === 1) {
runSingleCommand();
}
View gist:710f0196e63f698cc035edc536ece15b
alias develop="git checkout develop"
alias world='cd /cygdrive/c/git/gm-global-spredfast-gm-world-wall'
alias market='cd /cygdrive/c/git/gm.marketing.marketplace/MarketPlace.Web/Gm.Dm.Marketplace.WebUI'
cd /cygdrive/c/git/gm.marketing.marketplace/MarketPlace.Web/Gm.Dm.Marketplace.WebUI
alias parent='cd C:/git'
alias before-rebase='rm -vRf /cygdrive/c/git/gm.marketing.marketplace-before-rebase && cp -va /cygdrive/c/git/gm.marketing.marketplace /cygdrive/c/git/gm.marketing.marketplace-before-rebase'
View gist:0996c978d11eccf6e3ab174af8ce3db3
gulp = require('gulp');
gulp.task('setProduction', (cb) => {
process.env.CSS_DEST = 'dist/css';
process.env.JS_DEST = 'dist/js';
});
gulp.task('setDevelopment', (cb) => {
process.env.CSS_DEST = 'css/build';
process.env.JS_DEST = 'Scripts/build';
You can’t perform that action at this time.