Skip to content

Instantly share code, notes, and snippets.

View azanli's full-sized avatar
🐼
Doing all the things that pandas do...

Andy Li azanli

🐼
Doing all the things that pandas do...
  • Rally Health
  • San Francisco
View GitHub Profile
@azanli
azanli / Scramble Ordered Digits
Last active July 27, 2021 18:22
Scramble an ordered list of digits hashed by a secret passphrase
/*
* Scramble Ordered Digits
*
* This function takes in a `passphrase` and `limit` argument and returns
* a scrambled list of digits, n ... {limit}.
*
* This assumes that the original ordered digits are whole numbers starting
* from 1 ... {limit} where `limit` is the max digit.
*
* For example, `scrambleOrderedDigits('Hello World')` hashes 24 digits to the order on the right-hand side:
# Release log function
nearestThursday=$(date -v +Thur +%F)
lastReleaseCut=$(date -v +Thur -v -14d +%F)
# echo $nearestThursday
# echo $lastReleaseCut
nearestThursdayMonth=$(date -v +Thur +%m)
nearestThursdayDay=$(date +%d)
/* @flow */
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {|
ID: string,
String: string,
Boolean: boolean,
Int: number,
Float: number,
/** Enum that specifies where the ClinicalProcedure came from */
import idx from 'idx'
/*
* This code is copyright 2012 by Gavin Kistner, [email protected]
* It is covered under the license viewable at http://phrogz.net/JS/_ReuseLicense.txt
* Schwartzian transform - https://en.wikipedia.org/wiki/Schwartzian_transform
*
* This is used mainly for additional sorting among equal values due to efficiency.
* Example: sortBy(data, o => [o.active, o.age, o.name]);
* i.e. sort by active, then amongst active sort by age, then amongst
import React from 'react';
import { Linking, Text } from 'react-native';
export default function renderHyperlinkedText(string, baseStyles = {}, linkStyles = {}, openLink) {
if (typeof string !== 'string') return null;
const httpRegex = /http/g;
const wwwRegex = /www/g;
const comRegex = /.com/g;
const httpType = httpRegex.test(string);
const wwwType = wwwRegex.test(string);
@azanli
azanli / Email_Scraper.js
Last active February 6, 2024 20:45
An email scraper for websites - extracts names and emails from a page & inserts them into your Google Spreadsheet for Mail Merge
class Email_Scraper {
constructor(log = false, names = true, scriptURL = '', spreadsheetURL = '') {
this.currIndex = 0;
this.log = log;
this.names = names;
this.pendingRecursive = 1;
this.scriptURL = scriptURL;
this.spreadsheetURL = spreadsheetURL;
this.sourceIndex = 0;
this.sources = {};
@azanli
azanli / getFlatList.bash
Last active November 9, 2017 05:05 — forked from cooperka/getFlatList.bash
How to download FlatList and its related dependencies directly into your node_modules.
mkdir -p node_modules/react-native/Libraries/Lists/ && \
for file in 'FlatList' 'MetroListView' 'SectionList' 'VirtualizedList' 'VirtualizedSectionList' 'ViewabilityHelper' 'VirtualizeUtils' 'FillRateHelper'; \
do curl https://raw.githubusercontent.com/facebook/react-native/master/Libraries/Lists/${file}.js > node_modules/react-native/Libraries/Lists/${file}.js; \
done