Skip to content

Instantly share code, notes, and snippets.

View uneasyguy's full-sized avatar

Jeff Bingaman uneasyguy

View GitHub Profile
function myFunction() {
var symbols = ['STRATBTC','OMGBTC','BTCUSDT'];
var something_else = 'hello world';
var query_string = symbols.toString()+'&'+something_else;
var url = 'http://****public ip goes here****:5000/symbols/'+query_string;
var request = UrlFetchApp.fetch(url);
var data = JSON.parse(request.getContentText());
Logger.log(data);
}
@uneasyguy
uneasyguy / rc-local.service
Created July 18, 2019 20:10
rc-local.service from youtube video
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
@uneasyguy
uneasyguy / forever_shell.sh
Created July 18, 2019 20:08
forever_shell from youtube video
#!/bin/sh
/usr/local/bin/forever start -s --minUptime 1000 --spinSleepTime 1000 -c python3 ~/appscript/app.py
@uneasyguy
uneasyguy / rc.local
Last active October 25, 2019 23:43
rc.local from youtube video, replace ****USERNAME GOES HERE**** with username from vm instance
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
import requests
symbols = ['ETHBTC','XRPBTC','BTCUSDT']
something_else = 'hello world'
query_string = str(symbols)+'&'+something_else
url = f'http://127.0.0.1:5000/symbols/{query_string}'
r = requests.get(url)
data = r.json()
print(data)
from flask import Flask
from flask_restful import Api,Resource
from binance.client import Client
app = Flask(__name__)
api = Api(app)
class Prices(Resource):
def get(self,symbols,something_else):
client = Client(None,None)
@uneasyguy
uneasyguy / gscript_execution.py
Created April 9, 2019 02:09
script to run google apps scripts via python
from __future__ import print_function
import pickle
import os.path
from googleapiclient import errors
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
SCOPES = ['']
credentials_path = ''
@uneasyguy
uneasyguy / update_time
Created April 9, 2019 02:07
Google Sheets Function to update time
function update_time() {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
var ss = sheet.getSheetByName('Sheet1');
var formattedDate = Utilities.formatDate(new Date(), "UTC", "MM-dd-yyyy HH:mm:ss");
var merge_range = ss.getRange(3,3,3,3).merge().setHorizontalAlignment("center").setVerticalAlignment("center").setFontWeight("bold").setBorder(true,true,true,true,null,null,"black",SpreadsheetApp.BorderStyle.SOLID_MEDIUM).setFontSize(25);
var input_range = ss.getRange(3,3).setValue(formattedDate);
}
import os
import sys
import shutil
import multiprocessing as mp
from itertools import repeat as re
import dateparser
import pytz
import json
import csv
import datetime
import time
import dateparser
import pytz
import json
import csv
import datetime
from dateutil.rrule import rrule, MONTHLY
from binance.client import Client
import os
import sys