Skip to content

Instantly share code, notes, and snippets.

View SebConejo's full-sized avatar
😍
Building Mainfest 🦚

Sébastien Conejo SebConejo

😍
Building Mainfest 🦚
View GitHub Profile
@brunobuddy
brunobuddy / validateRegistrationNumber.ts
Created June 8, 2018 09:50
TypeScript SIRET Validation Script (French company registration number)
// Returns true if valid, false if not. Note that registrationNumber param is a string (usually provided by HTML imput)
validateRegistrationNumber(registrationNumber: string): boolean {
if (registrationNumber.length !== 14) {
return false
}
let sum = 0
let digit: number
for (let i = 0; i < registrationNumber.length; i++) {
if (i % 2 === 0) {
digit = parseInt(registrationNumber.charAt(i), 10) * 2
@razwan
razwan / _baseline.scss
Created April 14, 2014 16:20
Aligning type to baseline the right way with SASS
$base-font-size: 16px;
$base-line-height: 1.5;
// this value may vary for each font
// unitless value relative to 1em
$cap-height: 0.68;
@mixin baseline($font-size, $scale: 2) {