This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Directive, Component, Input, ViewContainerRef, TemplateRef, AfterViewInit} from '@angular/core'; | |
@Directive({selector: '[inView]'}) | |
export class InView implements AfterViewInit { | |
alreadyRendered: boolean; // cheking if visible already | |
constructor( | |
private vcRef: ViewContainerRef, | |
private tplRef: TemplateRef<any> | |
) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios, { AxiosResponse } from 'axios'; | |
import { get } from 'lodash-es'; | |
const rest = axios.create({ | |
baseURL: 'some base URL goes here', | |
}); | |
// this one send file as Blob type | |
const getPdf = () => ( | |
rest.get(`/get-pdf`, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function debounce<F extends Function>(func:F, wait:number):F { | |
let timeoutID:number; | |
if (!Number.isInteger(wait)) { | |
console.warn("Called debounce without a valid number") | |
wait = 300; | |
} | |
// conversion through any necessary as it wont satisfy criteria otherwise | |
return <any>function(this:any, ...args: any[]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Sample JavaScript file added with ScriptTag resource. | |
This sample file is meant to teach best practices. | |
Your app will load jQuery if it's not defined. | |
Your app will load jQuery if jQuery is defined but is too old, e.g. < 1.7. | |
Your app does not change the definition of $ or jQuery outside the app. | |
Example: if a Shopify theme uses jQuery 1.4.2, both of these statements run in the console will still return '1.4.2' | |
once the app is installed, even if the app uses jQuery 1.9.1: | |
jQuery.fn.jquery => "1.4.2" | |
$.fn.jquery -> "1.4.2" | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% assign warranty = false %} | |
{% for line in line_items %} | |
{% if line.sku == 'BB-WARRANTY' %} | |
{% assign warranty = true %} | |
{% endif %} | |
{% endfor %} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div className='delete-button' onClick={() => { if (window.confirm('Are you sure you wish to delete this item?')) this.onCancel(item) } } /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="row"> | |
<div class="col-md-3"> | |
<h3>Select files</h3> | |
<input type="file" #fileInput multiple (change)="addToQueue()" /> | |
</div> | |
<div class="col-md-9"> | |
<h3>Upload queue</h3> | |
<table class="table-headed table-striped"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first: | |
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
# go to /usr/local/lib and delete any node and node_modules | |
cd /usr/local/lib | |
sudo rm -rf node* |
NewerOlder