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 re import compile, search | |
from sys import exit | |
from time import strptime | |
from datetime import datetime, timedelta, tzinfo | |
#change this variable to point to the location of the apache access log file | |
LOG_FILE_LOCATION = '/var/log/httpd/access_log' | |
LINES_PROCESSED = 0 |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
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 pygments import highlight | |
from pygments.lexers import PythonLexer | |
from pygments.formatters import HtmlFormatter | |
code = """numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | |
evens = [number for number in numbers if number % 2 ==0] | |
print(evens) |
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
# Version 1 - Not tested | |
from pygments.style import Style | |
from pygments.token import (Keyword, Name, Comment, String, | |
Error, Number, Operator, Generic) | |
class DarkStyle(Style): | |
default_style = "" | |
styles = { | |
Comment: '#608b4e', |
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
<scheme name="Google Dark" version="142" parent_scheme="Darcula"> | |
<option name="FONT_SCALE" value="1.0" /> | |
<metaInfo> | |
<property name="created">2018-01-26T23:43:19</property> | |
<property name="ide">PyCharmCore</property> | |
<property name="ideVersion">2017.3.3.0.0</property> | |
<property name="modified">2018-01-26T23:43:29</property> | |
<property name="originalScheme">google dark</property> | |
</metaInfo> | |
<font> |
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
{ | |
// Materialize boilerplate | |
"Materialize Boilerplate": { | |
"prefix": "materialize", | |
"body": [ | |
"<!DOCTYPE html>", | |
"<html lang='en'>", | |
"<html>\n", | |
"\t<head>", | |
"\t\t<title>Materialize Boilerplate</title>", |
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 flask import Flask, render_template | |
from flask_socketio import SocketIO, send, emit | |
app = Flask(__name__) | |
app.config["SECRET_KEY"] = "secret!" | |
app.config["DEBUG"] = True | |
socketio = SocketIO(app) | |
@app.route("/") |
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
// Submit form data to the server | |
$("#form_id").submit(function(e){ | |
e.preventDefault(); | |
// Create object to send to the server | |
var data = { | |
varOne: $("#input_id").val() | |
} | |
// ajax setup |
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
import click | |
import json | |
def cprint(x=None): | |
""" | |
Pass any object into cprint to have it printed to the console in color! | |
json = yellow (json is pretty printed by default) | |
Python collections [list, dict, tuple] = green | |
Integers & floats = magenta |
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
// Get the previous form data from sessionStorage | |
var previousForm = JSON.parse(sessionStorage.getItem("formData")); | |
// Iterate through the form fields and polulate the form with sessionStorage values | |
for (let item in previousForm) { | |
$(`#${item}`).val(`${previousForm[item]}`); | |
} | |
$("#submit").click(function(){ | |
// Build sessionStorage object on form submit click | |
var formData = { |
OlderNewer