Skip to content

Instantly share code, notes, and snippets.

View jaxatax's full-sized avatar
👍
HTML CSS JS

jaxatax

👍
HTML CSS JS
View GitHub Profile
@jaxatax
jaxatax / randomCompany.js
Last active October 2, 2019 01:09
Makes a random fake company name.
// REFERENCE (Working with .txt Files in JS): https://www.freecodecamp.org/forum/t/how-to-read-local-text-file-into-a-js/231112
var fs = require('fs');
var textByLine = fs.readFileSync('allthewords.txt').toString().split("\n");
//get random element from array
Array.prototype.randomElement = function () {
return this[Math.floor(Math.random() * this.length)];
}
//console.log(textByLine[500]);
company = textByLine.randomElement() + " " + textByLine.randomElement() + "ly";
@jaxatax
jaxatax / randomWord.js
Created October 2, 2019 00:02
Random word generation in JS.
Array.prototype.randomElement = function () {
return this[Math.floor(Math.random() * this.length)];
}
var consonant = [
"th",
"th",
"n",
"mb",
"r",
import pyttsx3
import random
from random import *
import turtle
import datetime
from datetime import datetime
import time
from playsound import playsound
import requests
import math
@jaxatax
jaxatax / user_input.js
Created April 30, 2019 23:58 — forked from topherPedersen/user_input.js
Command-Line User Input in JavaScript (node.js)
// Code Snippet by Timmy Chen
// REFERENCE: https://repl.it/@timmy_i_chen/readline-sync-example-node
const rs = require('readline-sync');
const x = rs.question('enter thing: ');
console.log('wow you entered ' + x);
@jaxatax
jaxatax / get_sms_message.py
Created April 24, 2019 01:03
Getting the value of the message with Twilio and PythonAnywhere.
from flask import Flask, request, redirect
from twilio.twiml.messaging_response import MessagingResponse
app = Flask(__name__)
@app.route("/sms", methods=['GET', 'POST'])
def incoming_sms():
"""Send a dynamic reply to an incoming text message"""
# Get the message the user sent our Twilio number
body = request.values.get('Body', None)
@jaxatax
jaxatax / chatbot.py
Created April 24, 2019 00:37 — forked from topherPedersen/chatbot.py
Twilio Chatbook with Python & Flask
from flask import Flask
from twilio.twiml.messaging_response import MessagingResponse
import random
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def sms_reply():
"""Respond to incoming calls with a simple text message."""
@jaxatax
jaxatax / storyGenerator.py
Last active April 11, 2019 20:01
This is a program that makes a random story based on the words inside the different sentence structure functions.
import pyttsx3
from random import *
engine = pyttsx3.init()
def properNoun():
global properNounThing
n = randint(1,50)
if n == 1:
properNounThing = "Barry "
elif n == 2:
@jaxatax
jaxatax / getDallasWeather.py
Last active March 6, 2019 01:34
Get Weather For Dallas/Love Field
#https://www.geeksforgeeks.com/get-post-requests-using-python/
import requests
URL = "https://api.weather.gov/stations/KDAL/observations/latest/"
server_response = requests.get(url = URL)
data = server_response.json()
temperature = data['properties']['temperature']['value']
@jaxatax
jaxatax / basicNetworking.py
Created March 6, 2019 00:41
Basic Networking Python 3
#https://www.geeksforgeeks.com/get-post-requests-using-python/
import requests
URL = "https://topherpedersen.github.io/helloworld.html"
PARAMS = {'key':'value'}
server_response = requests.get(url = URL, params = PARAMS)
print(server_response.text)