Skip to content

Instantly share code, notes, and snippets.

View jqn's full-sized avatar

Joaquin Guardado jqn

View GitHub Profile
@jqn
jqn / Php56 install homebrew mac drupal
Created December 31, 2016 19:36 — forked from Greg-Boggs/Php56 install homebrew mac drupal
Install Php56 with Drupal configs on Mac with Homebrew with xedebug and OPcache
Steps to update local dev environment to PHP5.6 to be ready for Drupal 8.
In a terminal window:
brew update ( you may also may need brew doctor)
brew unlink php55
brew install php56 --with-homebrew-apxs --with-apache
brew install php56-xdebug
import PushNotification from 'react-native-push-notification';
import OneSignal from 'react-native-onesignal';
import { store, Settings } from './';
import { Notifications } from '../actions';
class NotificationController {
constructor () {
this.store = store;
this.token = null;
@jqn
jqn / gist:d85ad306ba9c87d8f608beeaf2a83360
Created May 16, 2017 19:48 — forked from jmervine/gist:2079897
installing mysql on ubuntu using an aws instance
$ sudo apt-get install mysql-server mysql-client
... output omitted ...
$ sudo mysqladmin -u root -h localhost password 'password'
... output omitted ...
$ mysql -u root -p
... output omitted ...
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'your_host_name' IDENTIFIED BY "password";
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
@jqn
jqn / 0_python_email.md
Created June 14, 2017 15:15 — forked from nickoala/0_python_email.md
Use Python to send and receive emails

Use Python to:

  • send a plain text email
  • send an email with attachment
  • receive and filter emails according to some criteria
@jqn
jqn / python_email.py
Created June 14, 2017 15:38 — forked from srv89/python_email.py
Python code for sending HTML email (Attachment + Multiple Recipients )
__author__ = 'srv'
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
username = '' # Email Address from the email you want to send an email
password = '' # Password
server = smtplib.SMTP('')
@jqn
jqn / pycon-views.py
Created April 7, 2018 03:35 — forked from miguelgrinberg/pycon-views.py
Generate statistics about PyCon 2014 videos
import argparse
import re
from multiprocessing.pool import ThreadPool as Pool
import requests
import bs4
root_url = 'http://pyvideo.org'
index_url = root_url + '/category/50/pycon-us-2014'
@jqn
jqn / pycon-views.py
Created April 7, 2018 03:35 — forked from miguelgrinberg/pycon-views.py
Generate statistics about PyCon 2014 videos
import argparse
import re
from multiprocessing.pool import ThreadPool as Pool
import requests
import bs4
root_url = 'http://pyvideo.org'
index_url = root_url + '/category/50/pycon-us-2014'
@jqn
jqn / thinced.js
Created October 11, 2018 14:07 — forked from varmais/thinced.js
Geolocation to Promise wrap example
var getPosition = function (options) {
return new Promise(function (resolve, reject) {
navigator.geolocation.getCurrentPosition(resolve, reject, options);
});
}
getPosition()
.then((position) => {
console.log(position);
})
@jqn
jqn / react-native-double-tap.js
Created March 4, 2019 14:05 — forked from brunotavares/react-native-double-tap.js
Double tap gesture recognition for React Native.
const DOUBLE_PRESS_DELAY = 300;
// ...
/**
* Double Press recognition
* @param {Event} e
*/
handleImagePress(e) {
const now = new Date().getTime();
/* Based on Sublime Text's Monokai theme */
.cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;}
.cm-s-monokai div.CodeMirror-selected {background: #49483E !important;}
.cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;}
.cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;}
.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;}
.cm-s-monokai span.cm-comment {color: #75715e;}
.cm-s-monokai span.cm-atom {color: #ae81ff;}