Skip to content

Instantly share code, notes, and snippets.

View mkv27's full-sized avatar
🎯
Focusing

Miguel Mendoza mkv27

🎯
Focusing
View GitHub Profile
@mkv27
mkv27 / google-maps-data-parser.js
Created May 11, 2022 00:56 — forked from jeteon/google-maps-data-parser.js
NodeJS script to parse the Google Maps "data" URL attribute into an array.
'use strict';
/**
* Basic code to parse the values in the "data" attribute in a Google Maps URL to an Array.
* There will likely still be some work to do to interpret the resulting Array.
*
* Based on information from:
* http://stackoverflow.com/a/34275131/1852838
* http://stackoverflow.com/a/24662610/1852838
*/
@mkv27
mkv27 / vercel-alias.yml
Created September 29, 2021 18:20 — forked from davedash/vercel-alias.yml
Vercel Alias Github Action
name: Vercel Alias
on: [deployment_status]
jobs:
alias:
if: |
github.event.deployment_status.state == 'success' &&
endsWith( github.event.deployment_status.target_url, '.vercel.app')
runs-on: ubuntu-latest
steps:
- uses: octokit/request-action@v2.x
@mkv27
mkv27 / nested-fql-template.js
Created May 20, 2020 18:08 — forked from ptpaterson/nested-fql-manual.js
Template for building deeply nested FQL queries for FaunaDB
const baseQuery = q.Paginate(q.Match(q.Index(indexName), terms));
// or
// const baseQuery = q.Paginate(q.Collection(collectionName))
const expandedQuery = q.Map(baseQuery, (ref) =>
q.Let(
{
instance: q.Get(q.Var('ref'))
},
{

Keybase proof

I hereby claim:

  • I am mkv27 on github.
  • I am mkv (https://keybase.io/mkv) on keybase.
  • I have a public key ASDJ2WE_DxdA_2OinSGgzsFkm135q1LqtGXyrM3yfXPvHQo

To claim this, I am signing this object:

@mkv27
mkv27 / Raw.swift
Created November 16, 2018 00:41 — forked from martijnwalraven/Raw.swift
Hacky way of getting a custom GraphQL scalar for raw JSON to work in Apollo iOS
typealias Raw = [String: JSONDecodable & JSONEncodable]
extension Dictionary: JSONDecodable {
public init(jsonValue value: JSONValue) throws {
guard let dictionary = forceBridgeFromObjectiveC(value) as? Dictionary else {
throw JSONDecodingError.couldNotConvert(value: value, to: Dictionary.self)
}
self = dictionary
}
}
@mkv27
mkv27 / djb2.js
Created October 27, 2018 02:55 — forked from eplawless/djb2.js
function hash(str) {
var len = str.length;
var hash = 5381;
for (var idx = 0; idx < len; ++idx) {
hash = 33 * hash + str.charCodeAt(idx);
}
return hash;
}
@mkv27
mkv27 / demo.js
Created March 14, 2018 21:00 — forked from bambooom/demo.js
merge two arrays and remove duplicate in es6
let arr1 = [3, 5, 2, 2, 5, 5];
let arr2 = [2, 1, 66, 5];
let unique = [...new Set([...arr1,...arr2])];
console.log(unique);
// [ 3, 5, 2, 1, 66 ]
@mkv27
mkv27 / .gitignore
Created October 23, 2017 22:23
.gitignore
# dependencies
node_modules
# logs
npm-debug.log
yarn-error.log
# Nuxt build
.nuxt
@mkv27
mkv27 / easing.css
Created June 22, 2017 00:15 — forked from bendc/easing.css
Easing CSS variables
:root {
--ease-in-quad: cubic-bezier(.55, .085, .68, .53);
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19);
--ease-in-quart: cubic-bezier(.895, .03, .685, .22);
--ease-in-quint: cubic-bezier(.755, .05, .855, .06);
--ease-in-expo: cubic-bezier(.95, .05, .795, .035);
--ease-in-circ: cubic-bezier(.6, .04, .98, .335);
--ease-out-quad: cubic-bezier(.25, .46, .45, .94);
--ease-out-cubic: cubic-bezier(.215, .61, .355, 1);
@mkv27
mkv27 / json_postgres.js
Created May 12, 2017 15:10 — forked from lucdew/json_postgres.js
Example of json document storage in postgresql and querying (with knex.js)
var connectionString = 'postgres://localhost:5432/postgres';
var Promise=require('bluebird');
var knex = require('knex')({
client: 'pg',
connection: {
user: 'postgres',
database: 'postgres',
port: 5432,