Skip to content

Instantly share code, notes, and snippets.

Avatar

Jess Delgado Perez jesatrix

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 / date.util.ts
Last active Aug 9, 2021
Random Utilities
View date.util.ts
import {
format,
formatDistanceToNow,
formatDuration,
formatISO,
intervalToDuration,
subMonths,
} from 'date-fns';
export class DateUtil {
@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