This file contains 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 parseURLParams | |
* Accepts a http parameter string or grabs the one from the current URL | |
* Returns a dictionary | |
* Ex: '?api_key=XYZ&version=2' => { api_key: 'XYZ', version: 2} | |
* | |
* query: string | undefined | |
*/ | |
function parseURLParams (query) { | |
if(!query) |
This file contains 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
// loading on "load" may cause FOUC | |
window.onload = function() { | |
var detective = new Detector(); | |
if (!detective.detect('Meat')) { | |
var url = 'link/to/style.css' | |
if (document.createStyleSheet) { | |
try { document.createStyleSheet(url); } catch (e) { } | |
} else { | |
var css; |
This file contains 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
import mysql.connector | |
mydb = mysql.connector.connect( | |
host="127.0.0.1", | |
user="root", | |
passwd="XXXXXX" | |
) | |
This file contains 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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<title> | |
Base IDLE game example | |
</title> | |
<style> | |
</style> | |
</head> | |
<body> |
This file contains 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
test |
This file contains 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(){ | |
$('form').submit{ | |
document.sessionStorage["form-data"] = $('this').serialize(); | |
document.location.href = 'another-page.html'; | |
} | |
}); | |
Expand snippet | |
At another-page.html: | |
var formData = document.sessionStorage["form-data"]; |
This file contains 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
yum install -y python3 | |
yum install -y git | |
yum install -y nano | |
yum install -y bzip2 | |
python3 -m pip install ansible | |
python3 -m pip install virtualenv | |
python3 -m pip install selinux | |
ansible-galaxy install galaxyproject.galaxy |
This file contains 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
docker logs nginx 2>&1 | grep "127." | |
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container |
This file contains 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
systemctl edit --force --full newservicename.service | |
``` | |
[Unit] | |
Description=backend | |
Requires=network.target | |
[Service] | |
Type=oneshot | |
Restart=yes | |
RestartSec=120 |
This file contains 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
eyJnb2xkIjo2MjY1LCJnZW1zIjowLCJwb3AiOjQ1MCwic2Vhc29uIjoxLCJ5ZWFyIjoxMzY0LCJmb29kIjoyMCwidHJlYXN1cnlHdWFyZCI6NSwiYnVpbGRMZXZlbEQiOjMsImJ1aWxkTGV2ZWxIIjoxMywiYnVpbGRMZXZlbFRyZWFzdXJ5IjozLCJidWlsZExldmVsR2FsbG93cyI6MCwiYnVpbGRMZXZlbEZvdW50YWluIjoxLCJidWlsZExldmVsU3Rhc2giOjEsImJ1aWxkTGV2ZWxJbm4iOjIsImJ1aWxkTGV2ZWxTdGFibGUiOjIsImJ1aWxkTGV2ZWxBcmNoZXJ5IjoyLCJidWlsZExldmVsU21pdGgiOjAsImZpcmUiOjAsImZpcmVTdGVwcyI6MCwiZmlyZUd1YXJkIjowLCJoZXJvIjowLCJoYXBwaW5lc3MiOjgwLCJvX2F1dG9zYXZlIjoxLCJuZXdTYXZlVmVyc2lvbiI6OCwic2F2ZVZlcnNpb24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