Vanilla Debounce esnextbin
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
function execute(generator, yieldValue) { | |
let next = generator.next(yieldValue); | |
if (!next.done) { | |
next.value.then( | |
result => execute(generator, result), | |
err => generator.throw(err) | |
); | |
} else { |
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
function loadScript(url) { | |
return new Promise(function(resolve, reject) { | |
try { | |
function callback() { | |
resolve(); | |
} | |
var s = document.createElement("script"); | |
s.src = url; | |
if (s.addEventListener) { | |
s.addEventListener("load", callback, false) |
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
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="/Users/smontoya/.oh-my-zsh" | |
# Set name of the theme to load --- if set to "random", it will | |
# load a random theme each time oh-my-zsh is loaded, in which case, | |
# to know which specific one was loaded, run: echo $RANDOM_THEME | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes |
###Sketch trial non stop
Open hosts files:
$ open /private/etc/hosts
Edit the file adding:
127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com
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
Future<Map<K, V>> awaitForMap<K, V>(Map<K, Future<V>> map) async { | |
final m = Map<K, V>(); | |
for (final K key in map.keys) { | |
try { | |
m[key] = await map[key]; | |
} catch (e) { | |
print(e); | |
m[key] = null; | |
} | |
} |
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 'package:latlong/latlong.dart'; | |
import 'dart:math' as math; | |
extension LatLngExtension on LatLng { | |
Map<String, double> toPoint() { | |
var siny = math.min( | |
math.max(math.sin(this.latitude * (math.pi / 180)), -.9999), | |
.9999, | |
); | |
return { |
http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}
- Subdomains: mt0, mt1, mt2, mt3.
- Examples:
- https://mts1.google.com/vt/x=1325&y=3143&z=13
- https://mt1.google.com/vt/lyrs=m&x=1325&y=3143&z=13
- Additional info:
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
function loadScript(url) { | |
return new Promise(function (resolve, reject) { | |
try { | |
function callback() { | |
resolve(url); | |
} | |
var s = document.createElement("script"); | |
s.src = url; | |
if (s.addEventListener) { | |
s.addEventListener("load", callback, false); |
Place YML in .github/workflows/ folder.
Get Token from: https://github.com/settings/tokens
git add .
git commit -m "Something"
git tag v#.#...
git push origin v#.#...