Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Nkansah Rexford seanmavley

🏠
Working from home
Block or report user

Report or block seanmavley

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
@seanmavley
seanmavley / network_available.js
Created Mar 29, 2016
check network connectivit
View network_available.js
// Register listeners
window.addEventListener("offline", function(){
$('#globalDiv').hide();
$("#message").html('WARNING: Internet connection has been lost.').show();
});
window.addEventListener("online", function(){
$("#message").empty().hide();
$('#globalDiv').show();
});
@seanmavley
seanmavley / forms for meteor.js
Created Mar 23, 2016
gather all form elements
View forms for meteor.js
<script>
(function() {
var form = document.getElementById('form_837299');
form.addEventListener('submit', function(event) {
// Prevent normal form submit
event.preventDefault();
});
View manual-backup-script.sh
#!/bin/bash
# backup using https://github.com/deajan/osync
# Usage:
# ./backup-script nameOfFolder
# e.g
# ~$ ./backup-script Folder SecondFolder
echo "Starting backup"
for i
@seanmavley
seanmavley / enable_mongo.sh
Created Jan 23, 2016 — forked from sgnn7/enable_mongo.sh
Mongodb 3.2 on Ubuntu 15.10
View enable_mongo.sh
echo '[Unit]
Description=High-performance, schema-free document-oriented database
After=syslog.target network.target
[Service]
User=mongodb
Group=mongodb
ExecStart=/usr/bin/mongod -f /etc/mongod.conf
[Install]
View primary.html
{% load pages_tags i18n mezzanine_tags %}
{% if page_branch_in_menu %}
{% if branch_level == 0 %}
<a href="#" data-activates="mobile-demo" class="button-collapse"><i class="material-icons">menu</i></a>
<ul class="right hide-on-med-and-down">
<li> <a class="modal-trigger" href="#searchbox"><i class="material-icons">search</i></a></li>
{% if user.is_authenticated %}
<li> <a href="{% url 'add_project' %}"><i class="material-icons">add</i></a></li>
{% endif %}
@seanmavley
seanmavley / gist:92a851b7ed6a1f36945a
Created Oct 11, 2015
Can't Sync Android Source Code on Ubuntu. Always getting: 'Failed to connect to android.googlesource.com port 443: Network is unreachable'. Enter the following commands, and profit
View gist:92a851b7ed6a1f36945a
sudo ip -6 route del default
net.ipv6.conf.default.accept_ra_defrtr = 0
@seanmavley
seanmavley / datalize.py
Last active Aug 29, 2015
Data URI for template images
View datalize.py
# templatetags/dataURI.py
from mimetypes import guess_type
from django import template
from base64 import b64encode
from django.contrib.staticfiles import finders
register = template.Library()
You can’t perform that action at this time.