Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Pablo Graviel Seo pablogravielseo

🏠
Working from home
Block or report user

Report or block pablogravielseo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pablogravielseo
pablogravielseo / sw.js
Created Aug 5, 2019
Streetwyze sw.js file on develop env
View sw.js
(function () {
'use strict';
const VERSION = '1565033042330|0.5158498022831546';
self.CACHE_BUSTER = VERSION;
self.addEventListener('install', function installEventListenerCallback(event) {
return self.skipWaiting();
});
self.addEventListener('activate', function installEventListenerCallback(event) {
return self.clients.claim();
View gist:89358d32ed07e5091680f5f3f3176cb2
This is the current flow and some details about the implemented features:
1. When the user visits the app, the service worker caches the "index.html" file and the "static assets",
after that, every page that the user visits it, the service worker caches,
so for example, if we go to "reports" page, after visiting will cache that page,
if we go to "surveys" page after visiting will cache and so on.
If the user disconnect the internet connection (or turn "offline" mode in the browser's dev tools, on network section) and
refresh the page, the app should still load and the user can navigate between the "cached pages".
2. We are caching the following resources:
View Stuck with android build
I have stucked in the process of building android, this are the scenarios where I stucked.
1. Followed "EmberCordova" documentation (http://embercordova.com).
Followed many times the documentation and I got this error on "android-studio" related to gradle version:
`> Could not find method google() for arguments [] on repository container.`
1.1. Followed gradle update documentation related to above error, but not have success:
https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration
2. Try "corber" addon (http://corber.io/).
@pablogravielseo
pablogravielseo / Flexible Dockerized Phoenix Deployments.md
Created Feb 28, 2018 — forked from jswny/Flexible Dockerized Phoenix Deployments.md
A guide to building and running zero-dependency Phoenix (Elixir) deployments with Docker. Works with Phoenix 1.2 and 1.3.
View Flexible Dockerized Phoenix Deployments.md

Prelude

I. Preface and Motivation

This guide was written because I don't particularly enjoy deploying Phoenix (or Elixir for that matter) applications. It's not easy. Primarily, I don't have a lot of money to spend on a nice, fancy VPS so compiling my Phoenix apps on my VPS often isn't an option. For that, we have Distillery releases. However, that requires me to either have a separate server for staging to use as a build server, or to keep a particular version of Erlang installed on my VPS, neither of which sound like great options to me and they all have the possibilities of version mismatches with ERTS. In addition to all this, theres a whole lot of configuration which needs to be done to setup a Phoenix app for deployment, and it's hard to remember.

For that reason, I wanted to use Docker so that all of my deployments would be automated and reproducable. In addition, Docker would allow me to have reproducable builds for my releases. I could build my releases on any machine that I wanted in a contai

View home.component.ts
import { Component, HostBinding } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Store } from '@ngrx/store';
import { elasticsearch } from 'app/core/elasticsearch';
import * as fromRoot from 'app/core/reducers/';
import { GlobalTemplateUtils } from 'app/shared/providers/globalTemplateUtils';
@pablogravielseo
pablogravielseo / package.json
Created Aug 3, 2017 — forked from addyosmani/package.json
npm run-scripts boilerplate
View package.json
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
View homebrew-permissions-issue.md

Homebrew Permissions Denied Issues Solution

Installing and fixing node.JS


brew install node

@pablogravielseo
pablogravielseo / gist:7d51b0a8b3149dd35ab6e2c9ab187f72
Created Feb 3, 2017 — forked from wrburgess/gist:5528649
Backup Heroku Postgres database and restore to local database
View gist:7d51b0a8b3149dd35ab6e2c9ab187f72

Grab new backup of database

Command: heroku pgbackups:capture --remote production

Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712

Get url of backup download

Command: heroku pgbackups:url [db_key] --remote production

View rename-files-ruby.rb
Dir["../image_migrations/establishments/*"].each do |establishment_id_dir|
Dir["#{establishment_id_dir}/*"].each do |products_dir|
Dir["#{products_dir}/*"].each do |product|
extension = File.extname(product).downcase
name = File.basename(product, extension)
formatted_name = ActiveSupport::Inflector.transliterate(name).parameterize.downcase.underscore
path = File.dirname(product)
new_path = "#{path}/#{formatted_name}#{extension}"
# puts new_path
@pablogravielseo
pablogravielseo / db.rake
Created Jan 3, 2017 — forked from hopsoft/db.rake
Rails rake tasks for dump & restore of PostgreSQL databases
View db.rake
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
end
puts cmd
You can’t perform that action at this time.