Skip to content

Instantly share code, notes, and snippets.

View rpavez's full-sized avatar

Rodrigo rpavez

  • San Francisco, CA - Santiago, Chile
View GitHub Profile
#!/bin/sh
export DB_NAME=<db_name>
export MYSQL_PASSWORD=<pass>
mysql -Nse 'show tables' $DB_NAME -u root -p$MYSQL_PASSWORD | while read table; do mysql -e "SET FOREIGN_KEY_CHECKS=0; truncate table $table;SET FOREIGN_KEY_CHECKS=1;" $DB_NAME -u root -p$MYSQL_PASSWORD ; done
@rpavez
rpavez / VSCODE
Created September 24, 2018 22:30
VSCODE
code --install-extension Atishay-Jain.All-Autocomplete
code --install-extension azemoh.one-monokai
code --install-extension christian-kohler.path-intellisense
code --install-extension dbaeumer.vscode-eslint
code --install-extension eamodio.gitlens
code --install-extension esbenp.prettier-vscode
code --install-extension felipe.nasc-touchbar
code --install-extension formulahendry.auto-close-tag
code --install-extension formulahendry.auto-rename-tag
code --install-extension kumar-harsh.graphql-for-vscode
@rpavez
rpavez / Errores
Created January 20, 2016 16:49
Errores API
pm2 logs
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From bitbucket.org:snuuper/api
d260453..af3ff4d master -> origin/master
Updating d260453..af3ff4d
Fast-forward
config.js | 15 +++++++++++----
[DBG] Input specified namespace Ext.ux, but entry was Cyzom.model.PanelSetting
[DBG] checking for scss file Cyzom.model.PersonalInfo
[DBG] Input specified namespace Ext.ux, but entry was Cyzom.model.PersonalInfo
[DBG] checking for scss file Cyzom.model.Subscription
[DBG] Input specified namespace Ext.ux, but entry was Cyzom.model.Subscription
[DBG] checking for scss file Cyzom.model.YearwiseData
[DBG] Input specified namespace Ext.ux, but entry was Cyzom.model.YearwiseData
[DBG] checking for scss file Cyzom.model.email.Email
[DBG] Input specified namespace Ext.ux, but entry was Cyzom.model.email.Email
[DBG] checking for scss file Cyzom.model.email.Friend
@rpavez
rpavez / MediaModule.h
Created November 11, 2015 14:58
Titanium takeScreenshot code
-(void)takeScreenshot:(id)arg
{
ENSURE_SINGLE_ARG(arg,KrollCallback);
ENSURE_UI_THREAD(takeScreenshot,arg);
// Create a graphics context with the target size
CGSize imageSize = [[UIScreen mainScreen] bounds].size;
UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0);
@rpavez
rpavez / gist:45ec3a6394d9a41baad8
Created March 5, 2015 14:42
Ti.ImageFactory Lib Tests
var ImageFactory = require('ti.imagefactory');
Ti.API.log("Image factory loaded");
Ti.App.resizeKeepAspectRatioPercentage = function(blob, percentage) {
try {
var imageTemp = Ti.UI.createImageView({
image : blob,
height : 'auto',
width : 'auto'
@rpavez
rpavez / backgroundLocationIOS.js
Created October 1, 2014 14:21
BasicGeo with iOS8 locationServicesAuthorization
var basicgeo = require("bencoding.basicgeo");
var available = basicgeo.createAvailability();
function sendLocation(location) {
/*
xhr.send({
latitude : location.coords.latitude,
longitude : location.coords.longitude
});
@rpavez
rpavez / gcm.js
Created September 30, 2014 14:29
/*global Ti: true, require: true */
(function(service) {
var serviceIntent = service.getIntent(), title = serviceIntent.hasExtra('title') ? serviceIntent.getStringExtra('title') : '', statusBarMessage = serviceIntent.hasExtra('message') ? serviceIntent.getStringExtra('message') : '', message = serviceIntent.hasExtra('message') ? serviceIntent.getStringExtra('message') : '';
Ti.App.Properties.setObject('pendingNotificationData', {
title : title,
statusBarMessage : statusBarMessage,
message : message,