Skip to content

Instantly share code, notes, and snippets.

View xantiagoma's full-sized avatar

Santiago Montoya A. xantiagoma

View GitHub Profile
@xantiagoma
xantiagoma / execute.js
Created January 31, 2019 19:20
Like Co library to execute Generatos and use yield as await
function execute(generator, yieldValue) {
let next = generator.next(yieldValue);
if (!next.done) {
next.value.then(
result => execute(generator, result),
err => generator.throw(err)
);
} else {
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)
@xantiagoma
xantiagoma / esnextbin.md
Created March 6, 2019 15:51 — forked from peduarte/esnextbin.md
Vanilla Debounce
# 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
@xantiagoma
xantiagoma / sketch-never-ending.md
Created August 8, 2019 02:23 — forked from Bhavdip/sketch-never-ending.md
Modify Sketch to never ending trial

###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

@xantiagoma
xantiagoma / async.dart
Last active July 19, 2022 16:23
Dart utils
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;
}
}
@xantiagoma
xantiagoma / latlong_extension.dart
Created January 18, 2020 22:01
LatLng Tilr x y z point
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 {
@xantiagoma
xantiagoma / Tiles.md
Last active March 24, 2025 12:12
Map tiles
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);
@xantiagoma
xantiagoma / README.md
Created July 27, 2020 15:43
Deploy Flutter App Github Actions (Android)