A Pen by Nariman Adam on CodePen.
//does not work with colors containing alpha | |
@function encodecolor($string) { | |
@if type-of($string) == 'color' { | |
$hex: str-slice(ie-hex-str($string), 4); | |
$string:unquote("#{$hex}"); | |
} | |
$string: '%23' + $string; | |
@return $string; | |
} |
Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.
All files were downloaded from https://cdnjs.com and named accordingly.
Output from ls
command is stripped out (irrelevant stuff)
$ ls -lhS
566K Jan 4 22:03 angular2.min.js
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
function add(num1, num2) { | |
num1 = num1.split(''); | |
num2 = num2.split(''); | |
num1 = num1.map(function (num) { | |
return parseInt(num, 10); | |
}); | |
num2 = num2.map(function (num) { | |
return parseInt(num, 10); |
I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.
I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.
Chrome 51 has some pretty wild behaviour related to console.log
in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.
1 - Make sure you have Counter Strike installed
2 - Download YAPB http://forums.bots-united.com/showthread.php?t=9986
3 - Extract the zip and move the folder addons
with all the content to ~/Library/Application Support/Steam/steamapps/common/Half-Life/cstrike
4 - After that, open the file liblist.gam
in the folder above and replace gamedll_osx "dlls/cs.dylib"
with this content:
//gamedll_osx "dlls/cs.dylib"
$layout-direction: ltr !default; | |
@mixin ltr { | |
@if $layout-direction == ltr { | |
@content; | |
} | |
} | |
@mixin rtl { | |
@if $layout-direction == rtl { | |
@content; |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/