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
<?php | |
// The 'microtime' code can be included in any method or application to track the script run time. | |
function test() | |
{ | |
// Get the (negative) current UNIX timestamp in milliseconds | |
$time = -microtime(true); | |
// Run some code | |
$hash = 0; |
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
netstat -ntlp | grep LISTEN |
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 re | |
from collections import Counter | |
SPEECH_TO_PROCESS = "Year End Press Conference -- (12-19-2014).txt" | |
# Open speech document | |
with open(SPEECH_TO_PROCESS, "r") as SPEECH_FILE: | |
# Read speech text into variable, converting any pesky unicode characters | |
speech = SPEECH_FILE.read().decode('utf8').encode("ascii", "ignore") |
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 re | |
from collections import Counter | |
SPEECH_TO_PROCESS = "Year End Press Conference -- (12-19-2014).txt" | |
IGNORE_WORDS = ["a", "an", "the", "and", "that", "is", "are", "were", "be", "be", "being", "been", "have", "has", "had", "do", "does", "did", "not", "it", "they", "its", "aboard", "about", "above", "across", "after", "against", "along", "amid", "among", "anti", "around", "as", "at", "before", "behind", "below", "beneath", "beside", "besides", "between", "beyond", "but", "by", "concerning", "considering", "despite", "down", "during", "except", "excepting", "excluding", "following", "for", "from", "in", "inside", "into", "like", "minus", "near", "of", "off", "on", "onto", "opposite", "outside", "over", "past", "per", "plus", "regarding", "round", "save", "since", "than", "through", "to", "toward", "towards", "under", "underneath", "unlike", "until", "up", "upon", "versus", "via", "with", "within", "without"] | |
# Open speech document | |
with open(SPEECH_TO_PROCESS, "r") as SPEECH_FILE: | |
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 re | |
from collections import Counter | |
SPEECH_TO_PROCESS = "Year End Press Conference -- (12-19-2014).txt" | |
# Open speech document | |
with open(SPEECH_TO_PROCESS, "r") as SPEECH_FILE: | |
# Read speech text into variable, converting any pesky unicode characters | |
speech = SPEECH_FILE.read().decode('utf8').encode("ascii", "ignore") |
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 json | |
import asyncio | |
from aiohttp import web, get | |
async def hello(request: web.Request): | |
print(request.headers) | |
return web.Response( | |
body=bytes(json.dumps(dict( | |
name='veggiecron-server', | |
author='Jacob Bridges', |
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
from flask import Flask | |
app = Flask(__name__) | |
# Create a route for the base endpoint | |
@app.route("/") | |
def hello(): | |
return "Hello World!" | |
# Run the server | |
app.run() |
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
var express = require('express'); | |
var app = express(); | |
// Create a route for the base endpoint | |
app.get('/', (req, res) => { | |
res.send('Hello World!'); | |
}); | |
// Run the server | |
app.listen(3000, () => null); |
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
# I don't even know where to begin. |
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
class PersonClass(object): | |
def __init__(self, name=None, cursor=None): | |
"""Constructor for PersonClass.""" | |
self.name = name | |
self.cursor = cursor | |
self.insert_sql = 'INSERT INTO person VALUES ?;' | |
async def create(self): | |
"""Persist the person to the database.""" |
OlderNewer