Skip to content

Instantly share code, notes, and snippets.

View scyrizales's full-sized avatar

Sergio Castillo Yrizales scyrizales

View GitHub Profile
@scyrizales
scyrizales / designer.html
Last active August 29, 2015 14:06
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
@scyrizales
scyrizales / SimpleVirtualRepeater.js
Created May 5, 2016 00:06
SimpleVirtualRepeater - This is an simple solution to handle thousands of results on an ng-repeat without sacrificing performance.
(function() {
'use strict';
angular.module('simple-virtual-repeater', [])
.directive('virtualRepeater', virtualRepeater);
virtualRepeater.$inject = ['$compile', '$timeout'];
function virtualRepeater($compile, $timeout) {
var directive = {
restrict: 'EA',
replace: 'true',
@scyrizales
scyrizales / lambda.js
Created April 30, 2019 22:03
Lambda@edge example
function isBotUserAgent(request) {
/*VALIDATE request.headers.user-agent*/
/**
Facebook: facebookexternalhit/1.1
Twitter: Twitterbot
Google: Googlebot
Slack: Slack
@scyrizales
scyrizales / transformLatLngToSphericThreeJS.js
Created September 30, 2022 00:22
Transformar coordenadas a esfera en ThreeJS
const latLngToVector3 = (latLng, radius) => {
// TODO: pending to fix the projections
const lat = parseFloat(latLng.lat);
const lng = parseFloat(latLng.lng);
const phi = Math.PI * (lat / 90);
const theta = Math.PI * (- (lng + 180) / 180);
const spherical = new THREE.Spherical(radius || 1, phi, theta);
const vector = new THREE.Vector3();
vector.setFromSpherical(spherical);