Skip to content

Instantly share code, notes, and snippets.

View hawkapparel's full-sized avatar

Christian Tamayo hawkapparel

View GitHub Profile
<template>
<div id="app" class="app">
<dialogs-wrapper name="lista-express" wrapper-name="lista-express" />
<dialogs-wrapper name="default" wrapper-name="default" />
<overlay v-if="overlayActive"/>
<loader/>
<sidebar-menu/>
<main-header/>
<notification/>
@hawkapparel
hawkapparel / Pull-and-Sync-Data-Between-Google-Doc-Spreadsheet-and-MySQL.gs
Created October 9, 2019 19:22
You can pull data from MySQL database to Google doc spreadsheet auto with just click of a button or scheduled time. This is great use for retrieving data in spreadsheet format.
// MySQL to Google Spreadsheet By Pradeep Bheron
// Support and contact at pradeepbheron.com
// If you like my content, please consider buying me a coffee. Thank you for your support! https://www.buymeacoffee.com/yoursupport
// Find detailed tutorial with screenshots here: https://medium.com/@ipradeep/pull-and-sync-data-between-google-doc-spreadsheet-and-mysql-1d5a09d787a4
function myMySQLFetchData() {
var conn = Jdbc.getConnection('jdbc:mysql://127.0.0.1:3306/employee_db', 'username', 'pass'); // Change it as per your database credentials
@hawkapparel
hawkapparel / PhoneNumberLine.vue
Created September 26, 2019 00:13 — forked from onurkose/PhoneNumberLine.vue
Dynamic component creation in Vue.js
<template>
<div>
<div v-for="(line, index) in lines" v-bind:key="index" class="row">
<div class="col-lg-6">
<div class="row">
<div class="col-2">
<q-select
v-model="line.countryCode"
float-label="Country Code"
:options="countryPhoneCodes"
@hawkapparel
hawkapparel / Chromium Mobile Device List
Created August 29, 2019 13:43 — forked from devinmancuso/Chromium Mobile Device List
Mobile Device Emulation List from Chromium
#Pulled from Chromium at: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/devtools/front_end/toolbox/OverridesUI.js&q=WebInspector.OverridesUI._phones%20file:OverridesUI.js&sq=package:chromium&type=cs&l=310
#Phones
Define_phones = [
{deviceName: "Apple iPhone 3GS", width: 320, height: 480, deviceScaleFactor: 1, userAgent: "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5", touch: true, mobile: true},
{deviceName: "Apple iPhone 4", width: 320, height: 480, deviceScaleFactor: 2, userAgent: "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5", touch: true, mobile: true},
{deviceName: "Apple iPhone 5", width: 320, height: 568, deviceScaleFactor: 2, userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Versi
function getDistanceFromLatLonInKm(lat1,lon1,lat2,lon2) {
var R = 6371; // Radius of the earth in km
var dLat = deg2rad(lat2-lat1); // deg2rad below
var dLon = deg2rad(lon2-lon1);
var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.sin(dLon/2) * Math.sin(dLon/2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
var d = R * c; // Distance in km
return d;
}
@hawkapparel
hawkapparel / conf_nuxt
Last active April 16, 2019 22:24
Configuration reverse proxy nginx + nuxt
#proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=nuxt-cache:25m max_si$
map $sent_http_content_type $expires {
#"text/html" 1h; # set this to your needs
#"text/html; charset=utf-8" 1h; # set this to your needs
default 30d; # set this to your needs
}
server {
listen 80; # the port nginx is listening on
@hawkapparel
hawkapparel / Convert MKV to MP4 in Linux DEBIAN 9
Created January 21, 2019 03:23
Convert MKV to MP4 in Linux DEBIAN 9
sudo apt-get update
sudo apt-get install ffmpeg
Confirm the installation
Now run the following command:
ffmpeg -version
comand:
@hawkapparel
hawkapparel / js
Created January 19, 2019 20:41
Example AJAX with native VANILLA JS
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Ejemplo API</title>
</head>
<body>
<h1>EJEMPLO API</h1>
</body>
@hawkapparel
hawkapparel / FIX ENOSPC YARN
Created December 13, 2018 05:25
Error: watch /var/www/shards/public ENOSPC
ERROR:
yarn run v1.12.3
$ vue-cli-service serve
INFO Starting development server...
10% building modules 1/1 modules 0 activeevents.js:183
throw er; // Unhandled 'error' event
^
Error: watch /var/www/shards/public ENOSPC
at FSWatcher.start (fs.js:1382:19)
@hawkapparel
hawkapparel / tablapaises.sql
Created December 12, 2018 07:50 — forked from angeldelrio/tablapaises.sql
Tabla MySQL paises el mundo en español
CREATE TABLE `paises` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) DEFAULT NULL,
`nombre` varchar(80) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
INSERT INTO `paises` VALUES(1, 'AF', 'Afganistán');
INSERT INTO `paises` VALUES(2, 'AX', 'Islas Gland');
INSERT INTO `paises` VALUES(3, 'AL', 'Albania');