Skip to content

Instantly share code, notes, and snippets.

@neilbo
neilbo / browser.ts
Created July 3, 2018 04:39
Angular Browser Provider (Ionic)
import { Injectable } from '@angular/core';
import {
InAppBrowser,
InAppBrowserOptions
} from "@ionic-native/in-app-browser";
import { Platform } from "ionic-angular";
@Injectable()
export class BrowserProvider {
import { Pipe, PipeTransform } from "@angular/core";
import startCase from "lodash/startCase";
@Pipe({
name: "startCase"
})
export class StartCasePipe implements PipeTransform {
/**
* Takes a string such as 'isCamelCase' and makes it 'Is Camel Case'.
*/
transform(value: string) {
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'thousandsComma',
})
export class ThousandsCommaPipe implements PipeTransform {
/**
* Takes a value and makes it '1000' or 1000 to '1,000'.
*/
transform(value: any) {
#!/bin/bash
set -eu
SENTRY_DOWNLOAD_Linux_i686="https://downloads.sentry-cdn.com/sentry-cli/1.44.1/sentry-cli-Linux-i686"
SENTRY_DOWNLOAD_Windows_x86_64="https://downloads.sentry-cdn.com/sentry-cli/1.44.1/sentry-cli-Windows-x86_64.exe"
SENTRY_DOWNLOAD_Darwin_x86_64="https://downloads.sentry-cdn.com/sentry-cli/1.44.1/sentry-cli-Darwin-x86_64"
SENTRY_DOWNLOAD_Linux_x86_64="https://downloads.sentry-cdn.com/sentry-cli/1.44.1/sentry-cli-Linux-x86_64"
SENTRY_DOWNLOAD_Windows_i686="https://downloads.sentry-cdn.com/sentry-cli/1.44.1/sentry-cli-Windows-i686.exe"
VERSION="1.44.1"
PLATFORM=`uname -s`
@mixin smooth-scrolling() {
overflow-y: scroll; /* has to be scroll, not auto */
-webkit-overflow-scrolling: touch;
}
@include smooth-scrolling();
@neilbo
neilbo / medicare_card.js
Created April 17, 2023 20:55 — forked from Ugrend/medicare_card.js
Random Medicare Card Generator
//Reference: http://www.clearwater.com.au/code/provider
const randomMedicareNumber = ()=>{
let sum = Math.floor(Math.random() * 5) +2;
const weights = [1, 3, 7, 9, 1, 3, 7, 9];
let num = [sum]
for(let i = 0 ; i < 7 ; i++){
let n = Math.floor(Math.random()*10)
sum += n * weights[i+1];