I hereby claim:
-
I am caferrari on github.
-
I am caferrari (https://keybase.io/caferrari) on keybase.
-
I have a public key ASB4b7hDwJ1bx34sJu6j46jawrnRB0HEoesStVo2VmGWBAo
import { Request, Response, NextFunction, Router } from 'express'; | |
import { Schema } from 'zod'; | |
type tParams<B = unknown, P = unknown, Q = unknown> = { | |
body?: Schema<B>; | |
params?: Schema<P>; | |
query?: Schema<Q>; | |
}; | |
type callbackFn<B, P, Q> = (req: Request<P, any, B, Q>, res: Response, next: NextFunction) => Promise<void>; | |
type postParams<B, P> = Pick<tParams<B, P, never>, 'params' | 'body'>; |
const decode = (input: string) => { | |
const chars = input.trim().replace(/\n/g, ''); | |
const data = Buffer.from(chars, 'base64').toString('utf-8'); | |
const payload = JSON.parse(data); | |
const dic = Buffer.from(payload.dic, 'base64').toString('utf-8'); | |
const letters = payload.message.split(',').map((char: string) => dic[Number(char)]); | |
return letters.join(''); | |
} |
I hereby claim:
I am caferrari on github.
I am caferrari (https://keybase.io/caferrari) on keybase.
I have a public key ASB4b7hDwJ1bx34sJu6j46jawrnRB0HEoesStVo2VmGWBAo
def numberOfHoursBack = 30*24 | |
def diff = ((System.currentTimeMillis() / 1000) - (numberOfHoursBack * 60 * 60)) * 1000 | |
def totalBuildTime = | |
Jenkins.instance.getItems(Job.class).collect { job -> | |
job.getBuilds().byTimestamp(diff.longValue() , System.currentTimeMillis()) | |
} | |
.flatten() | |
.collect { build -> build.getDuration() } | |
.sum() |
import { Injectable, Injector } from '@angular/core'; | |
import { | |
HttpInterceptor, | |
HttpRequest, | |
HttpHandler, | |
HttpEvent | |
} from '@angular/common/http'; | |
I hereby claim:
To claim this, I am signing this object:
version: '2' | |
services: | |
proxy: | |
image: tegra/go:proxy | |
ports: | |
- "8888:80" | |
links: | |
- go | |
- web | |
const exec = require('child_process').exec; | |
const fs = require('fs'); | |
const iconv = (from, to, encoding, isFallback) => { | |
return new Promise((resolve, reject) => { | |
exec(`iconv -f ${encoding.trim()} -t utf-8 ${from} > ${to}`, (err) => { | |
if (err && !isFallback) { | |
return resolve(iconv(from, to, 'ISO_8859-1', true)); | |
} | |
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
(function() { | |
'use strict'; | |
angular.module('App') | |
.factory('authInterceptor', ['API', 'auth', authInterceptor]); | |
function authInterceptor(API, auth) { | |
return { | |
request: function(config) { | |
if (config.url.indexOf(API) === 0) { |