Skip to content

Instantly share code, notes, and snippets.

View howardpanton's full-sized avatar

Howard Panton howardpanton

View GitHub Profile
@howardpanton
howardpanton / npm-prerelease.md
Created April 8, 2020 12:42 — forked from schmich/npm-prerelease.md
Publish a prerelease package to NPM
  • Update package.json, set version to a prerelease version, e.g. 2.0.0-rc1, 3.1.5-rc4, ...
  • Run npm pack to create package
  • Run npm publish <package>.tgz --tag next to publish the package under the next tag
  • Run npm install --save package@next to install prerelease package
@howardpanton
howardpanton / Random-string
Created March 25, 2020 23:07 — forked from 6174/Random-string
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
# Get the latest from GitHub, public repo:
$ npm install username/my-new-project --save-dev
# GitHub, private repo:
$ npm install git+https://token:[email protected]/username/my-new-project.git#master
$ npm install git+ssh://[email protected]/username/my-new-project.git#master
# … or from Bitbucket, public repo:
$ npm install git+ssh://[email protected]/username/my-new-project.git#master --save-dev
# Bitbucket, private repo:
$ npm install git+https://username:[email protected]/username/my-new-project.git#master
@howardpanton
howardpanton / brew_symlink_error_sierra.md
Created October 20, 2018 21:45 — forked from dalegaspi/brew_symlink_error_sierra.md
Homebrew Symlink errors in Mac OSX High Sierra
@howardpanton
howardpanton / sanitizehtml.pipe.ts
Created April 17, 2018 11:10 — forked from schmidt1024/sanitizehtml.pipe.ts
angular 4 pipe for bypass security trust html
// <div [innerHTML]="your.value | sanitizeHtml" ></div>
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
@Pipe({name: 'sanitizeHtml'})
export class SanitizeHtmlPipe implements PipeTransform {
constructor(private _sanitizer:DomSanitizer) {
}
transform(v:string):SafeHtml {
@howardpanton
howardpanton / Dockerfile
Created February 8, 2018 14:04
Angular Dockerfile
# Pull the latest Node image from Docker
FROM node:latest
# Copy the current directory contents into the container at /app
COPY ./ /app/
# Set the working directory to /app
WORKDIR /app
# Install Node Modules
@howardpanton
howardpanton / hapijs-rest-api-tutorial.md
Created July 28, 2016 13:31 — forked from agendor/hapijs-rest-api-tutorial.md
A practical introduction to building a RESTful API with the hapi.js server framework for Node.js
@howardpanton
howardpanton / Fix Cygwin Issue with RubyGem
Created October 8, 2015 13:19 — forked from devcfgc/Fix Cygwin Issue with RubyGem
No such file or directory — /cygdrive/c/Ruby/bin/gem (LoadError)
//We must add the following to your .bashrc (C:\cygwin\home\user\.bashrc):
alias ruby='/cygdrive/c/Ruby21-x64/bin/ruby'
alias gem='/cygdrive/c/Ruby21-x64/bin/gem.bat'
alias irb='/cygdrive/c/Ruby21-x64/bin/irb.bat'
alias compass='/cygdrive/c/Ruby21-x64/bin/compass.bat'
alias sass='/cygdrive/c/Ruby21-x64/bin/sass.bat'
alias scss='/cygdrive/c/Ruby21-x64/bin/scss.bat'
//
// Matslab Question 5 Bonus
// Howard PAnton
//
(function() {
// Add new input option
$(".add_button").click(function(){
var value = $(".option_name").val();
<?php
//Q1. PHP - Complete remove_nonAtoZ() below
function remove_nonAtoZ($input) {
// example data: $input = "BA'3Ndf$%^A&*(nN)A";
// $output = "BANANA";
// Create RegExpr to remove non capital letters
$pattern = "/[A-Z]+/";
// Filter using Preg Match
preg_match_all($pattern, $input, $match);