Skip to content

Instantly share code, notes, and snippets.

View jqn's full-sized avatar

Joaquin Guardado jqn

View GitHub Profile
@jqn
jqn / README-Template.md
Created June 23, 2020 11:41 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@jqn
jqn / gist:45c9fd4a8e622256f652afbba015e758
Created December 16, 2019 09:26 — forked from GrahamDumpleton/gist:b380652b768e81a7f60c
Setting environment variables for Apache/mod_wsgi hosted Python application.

Django documentation says to use:

WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py
WSGIPythonPath /path/to/mysite.com

<Directory /path/to/mysite.com/mysite>
<Files wsgi.py>
Require all granted
@jqn
jqn / gist:835f41144d09ac7e2d896c2ffd0bc7c6
Created December 16, 2019 09:26 — forked from GrahamDumpleton/gist:b380652b768e81a7f60c
Setting environment variables for Apache/mod_wsgi hosted Python application.

Django documentation says to use:

WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py
WSGIPythonPath /path/to/mysite.com

<Directory /path/to/mysite.com/mysite>
<Files wsgi.py>
Require all granted
@jqn
jqn / read_aws_credentials.py
Created December 10, 2019 14:19 — forked from wjimenez5271/read_aws_credentials.py
Simple python 2.7 implementation of a config reader for ~/.aws/credentials file
def get_profile_credentials(profile_name):
from ConfigParser import ConfigParser
from ConfigParser import ParsingError
from ConfigParser import NoOptionError
from ConfigParser import NoSectionError
from os import path
config = ConfigParser()
config.read([path.join(path.expanduser("~"),'.aws/credentials')])
try:
aws_access_key_id = config.get(profile_name, 'aws_access_key_id')
@jqn
jqn / background.js
Created September 13, 2019 11:28 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@jqn
jqn / MainActivity.java
Last active August 14, 2019 19:31 — forked from ssaurel/MainActivity.java
Main Activity for the GPS Tutorial on the SSaurel's Blog
package com.ssaurel.fusedlocation;
import android.Manifest;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
import android.location.Location;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
@jqn
jqn / React Native (Android) - Rename applicationID, package name.md React Native (Android) - [ Changing application package name/bundle identifier ]

React Native (Android) - [ Changing application package name/bundle identifier ]

List of files to edit to change/rename your react-native android project. The following constants are used in the files to denote what kind of value should be placed.

  • APPLICATION_NAME - this will be used by react-native to identify your application. (settings.gradle, MainActivity.java, etc.)
  • APPLICATION_DISPLAY_NAME - display name in Android Home Screen.
  • ANDROID_PACKAGE_NAME - A valid android package name.
@jqn
jqn / github-monokai.css
Created May 5, 2019 19:41 — forked from cyrilis/github-monokai.css
Github Monokai Code Style
.file-code-line .blob-line-code {
background: #333;
}
.file-code-line .blob-line-nums {
background: #292929;
border-right: 3px solid #707070;
color: #c0c0c0;
}
/* 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;}
@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();