Skip to content

Instantly share code, notes, and snippets.

Avatar
🖖
Live long and prosper

Jess Delgado Perez jesatrix

🖖
Live long and prosper
View GitHub Profile
@jesatrix
jesatrix / console_angular_var_update.js
Created Jan 27, 2017
Access a variable within the console
View console_angular_var_update.js
var $scope = angular.element($0).scope();
$scope.$apply(function () {
// SET VARIABLE HERE
});
@jesatrix
jesatrix / streams.get.ts
Last active Aug 3, 2021
Streams Sample
View streams.get.ts
import { pipeline, Transform, TransformCallback } from 'stream';
import { promisify } from 'util';
import { env } from 'process';
import axios, {
AxiosInstance,
AxiosRequestConfig,
AxiosResponse,
ResponseType,
} from 'axios';
import * as JSONStream from 'jsonstream-next';
View timestamp.sh
get_duration () {
: ${1?"You must provide a number value"}
num=$1
min=0
hour=0
day=0
if((num>59));then
((sec=num%60))
((num=num/60))
if((num>59));then
View array.util.ts
/**
* Merge two distinct arrays into a single, unique record
* @param originalArray Starting version of the array
* @param newArray New values to append to the array
* @returns A unique array of values
*/
export function mergeArrays<T>(originalArray?: T[], newArray?: T[]) {
return (
(Array.isArray(originalArray)
? [...new Set([...originalArray, ...(newArray ?? [])])]?.filter((v) => typeof v !== 'undefined')
@jesatrix
jesatrix / array.util.ts
Last active Dec 2, 2022
Random Utilities
View array.util.ts
/**
* Merge two distinct arrays into a single, unique record
* @param originalArray Starting version of the array
* @param newArray New values to append to the array
* @returns A unique array of values
*/
export function mergeArrays<T>(originalArray?: T[], newArray?: T[]) {
return (
(Array.isArray(originalArray)
? [...new Set([...originalArray, ...(newArray ?? [])])]?.filter((v) => typeof v !== 'undefined')