This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getVersion() { | |
if (navigator.userAgent.match(/(mobile|tablet)/i)) { | |
var ffVersionArray = (navigator.userAgent.match(/Firefox\/([\d]+\.[\w]?\.?[\w]+)/)); | |
if (ffVersionArray.length === 2) { | |
//Check with the gecko version the Firefox OS version | |
//Table https://developer.mozilla.org/en-US/docs/Gecko_user_agent_string_reference | |
var hashVersion = { | |
'18.0': '1.0.1', | |
'18.1': '1.1', | |
'26.0': '1.2', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@property | |
def _dict(self): | |
from django.db.models.query_utils import DeferredAttribute | |
exclude = [f.name for f in self._meta.fields if | |
isinstance(self.__class__.__dict__.get(f.attname), | |
DeferredAttribute)] | |
return model_to_dict(self, fields=[field.name for field in | |
self._meta.fields], exclude=exclude) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Automate mysql secure installation for debian-baed systems | |
# | |
# - You can set a password for root accounts. | |
# - You can remove root accounts that are accessible from outside the local host. | |
# - You can remove anonymous-user accounts. | |
# - You can remove the test database (which by default can be accessed by all users, even anonymous users), | |
# and privileges that permit anyone to access databases with names that start with test_. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Stop all containers | |
containers=`docker ps -a -q` | |
if [ -n "$containers" ] ; then | |
docker stop $containers | |
fi | |
# Delete all containers | |
containers=`docker ps -a -q` | |
if [ -n "$containers" ]; then | |
docker rm -f -v $containers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scapy.all import * | |
import requests | |
import time | |
MAGIC_FORM_URL = 'http://put-your-url-here' | |
def record_poop(): | |
data = { | |
"Timestamp": time.strftime("%Y-%m-%d %H:%M"), | |
"Measurement": 'Poopy Diaper' | |
} |