Skip to content

Instantly share code, notes, and snippets.

View pom421's full-sized avatar
🦊
Yes, What's happening?

Pierre-Olivier Mauguet pom421

🦊
Yes, What's happening?
View GitHub Profile
@pom421
pom421 / Regex
Last active April 17, 2017 14:20
Référence : https://www.codewars.com/kata/please-help-bob/javascript
Exemples :
"Hello, I am Mr Bob" --> "Hello, I amerr Mrerr Boberr"
"THIS IS CRAZY!" --> "THISERR ISERR CRAZYERR!"
const errBob = string =>
string
.replace(/([bcdfghjklmnpqrstvwxyz])(\W|$)/g, '$1err$2')
@pom421
pom421 / .bash_profile
Created October 17, 2017 17:40
Set/unset proxy
# Set Proxy
function setproxy() {
export PROXY=http://10.10.10.10:8080
export {http,https,ftp}_proxy=$PROXY
export {HTTP,HTTPS,FTP}_PROXY=$PROXY
# git
git config --global http.proxy $PROXY
git config --global https.proxy $PROXY
@pom421
pom421 / fetch-api-examples.md
Last active October 6, 2023 14:13 — forked from justsml/fetch-api-examples.md
JavaScript Fetch API Examples

Dan's Bug Hunting Tips & Tricks

for JavaScript

This is a quick rundown on key JavaScript Error and Exception handling pitfalls.

Includes snippets which apply across the JS ecosystem, including Client-side, Back-end and everything in-between!


Everyone from rookies to Node Team members forget this shit all the time. Myself included.

Suppose we want to encode <toto, so :
< t o t o
60 116 111 116 111 // in decimal
00111100 01110100 01101111 01110100 01101111 // in binary
00111100 01110100 01101111 01110100 01101111 00000000 // add optionnal complement (00000000) to have a multiple of 24 bits
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
# gcd
def gcd(a: Int, b: Int): Int = if (b == 0) a else gcd(b, a % b)
import { Injectable } from '@angular/core';
import { of, throwError } from 'rxjs';
import { Company, CompanySearchResult, CompanyFromAddok, Feature } from '../model/Company';
import { HttpClient, HttpParams } from '@angular/common/http';
import { Api, ServiceUtils } from './service.utils';
import { catchError, map, pluck, filter, flatMap } from 'rxjs/operators';
import { deserialize } from 'json-typescript-mapper';
export const MaxCompanyResult = 20;
export const Radius = 0.2;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<span id="anchor" tabindex="-1" style="outline: none"></span>