This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
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.
Example-heavy JS reference notes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gcd | |
def gcd(a: Int, b: Int): Int = if (b == 0) a else gcd(b, a % b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
OlderNewer