Skip to content

Instantly share code, notes, and snippets.

View Ynote's full-sized avatar
🌻

Fanny Cheung Ynote

🌻
View GitHub Profile
function(value) {
var float = parseFloat(value)
if (isNaN(float)) return false
if (!isFinite(float)) return false
return String(float) === String(value)
}
@Ynote
Ynote / castingNumberIntoString.js
Created November 18, 2018 11:04
Casting number into string
const hexaValue = 0x2a
// => 42
String(hexaValue)
// => "42"
hexaValue.toString()
// => "42"
@Ynote
Ynote / numberExamples.js
Last active November 18, 2018 11:01
Number examples
typeof 42e42
// => 'number'
typeof 0x2a
// => 'number'
typeof Infinity
// => 'number'
typeof +''
@Ynote
Ynote / dot-css-dot-js.md
Created November 10, 2018 11:28
[Conferences] Some thoughts about DotCSS and DotJS 2018

About DotJS and DotCSS 2018

This year, I preferred DotCSS to DotJS. Some talks were amazing and inspiring. The atmosphere was kind and I talked to some speakers ! (@frivoal, @natalyathree AAAANNNND @SaraSoueian <3 <3).

DotCSS

About text wrapping and line-breaking

This talk was done by Florian Rivoal. He describes some new features to handle line-breaks and text-wrapping better. Some are already implemented in some browsers, some not. What I noted :

  • Whitespace CSS rules (pre, preline, etc.) use several steps to deal with whitespace.
@Ynote
Ynote / odd-int-in-array.js
Created November 25, 2017 12:38
[JavaScript] - Find the integer in the array which occurences number is odd
// cf. https://en.wikipedia.org/wiki/Bitwise_operation#XOR
const findOdd = arr => arr.reduce((acc, val) => acc ^ val)
@Ynote
Ynote / atomic-css-2.css
Created July 9, 2017 14:47
Medium - atomic CSS snippet
.display-flex { display: flex; }
.flex-items-center { align-items: center; }
@media (max-width: 600px) {
.align-center-on-md {
text-align: center;
}
}
// etc…
@Ynote
Ynote / BEM-methodology-2.css
Created July 9, 2017 14:42
Medium - BEM methodology CSS snippet
.header { … }
.header-image { … }
@media (max-width: 600px) {
.header .header-image { … }
}
@Ynote
Ynote / BEM-methodology-2.html
Last active July 11, 2017 16:49
Medium - BEM methodology snippet
<div class="header">
<img src="image.png" class="header__image" />
<div>
@Ynote
Ynote / atomic-css-2.html
Last active July 9, 2017 14:48
Medium - atomic CSS snippet
<div class="display-flex flex-items-center flex-column-on-md align-center-on-md padding-all-md grey top-border-radius-sm border-sm-grey border-bottom-md-blue">
<img src="image.png" class="display-block margin-end-md width-30 border-radius-xxl margin-bottom-md-on-md" />
</div>
@Ynote
Ynote / BEM-methodology.html
Last active July 9, 2017 13:28
Medium - BEM methodology snippet
<div class="project-card">
<h4 class="project-card__title">Mon nouveau projet</h4>
<p class="project-card__description">Une description passionnante</p>
<a class="project-card__action project-card__action-primary">Découvrir</a>
<div>