Skip to content

Instantly share code, notes, and snippets.

View gdoteof's full-sized avatar

geoff golder gdoteof

  • vision.ai
  • Burlington, VT
View GitHub Profile
@gdoteof
gdoteof / inspect.js
Created August 30, 2017 20:01
viewing large javascript objects
var fs = require('fs');
var exec = require('child_process').exec;
function inspect(object, filename) {
var html = "<script>var j = " + JSON.stringify(object) + "; console.log(j);</script> open console";
var tmpFile = (filename) ? filename : "/tmp/inspect.html";
fs.writeFileSync(tmpFile, html)
exec("open " + tmpFile);
}
@gdoteof
gdoteof / 4.m
Last active September 29, 2018 18:09
function output = sigmoid(incoming)
output = 1/(1+(exp(incoming * -1)))
endfunction
%question 4
Wxh=-.1
Whh=.5
Why=.25
hbias=.4
ybias=0
@gdoteof
gdoteof / expandJson.py
Last active October 21, 2018 16:02
An attempt
def expandJson(df, colName):
jsonString = df.iloc[0][colName]
decoded = json.loads(jsonString)
attrs = decoded.keys()
fld = df[colName]
for attr in attrs: df[attr] = json.loads(fld)[attr]
def expandJson(df, colName):
jsonString = df.iloc[0][colName]
decoded = json.loads(jsonString)
attrs = decoded.keys()
print(attrs)
fld = df[colName]
for attr in attrs: df[colName+attr] = [loadjson(x,attr) for x in fld]
@gdoteof
gdoteof / ytchatlogger.js
Created November 2, 2018 01:47
youtube chat logger
function lastMessage(){
let a = document.getElementsByTagName('yt-live-chat-text-message-renderer');
return {
user: a[a.length-1].getElementsByTagName('yt-live-chat-author-chip')[0].innerText,
message: a[a.length-1].querySelector('#message').innerText,
}
}
window.ggCacheChat = {user:'',message:''}
(function(){
select = document.createElement("select");
selectId = "insertedSelect";
select.id = selectId;
options =[
{p:49, cost:"599" , label:"35,000 FBA Orders"},
{p:50, cost:"799" , label:"50,000 FBA Orders"},
{p:51, cost:"1099", label:"75,000 FBA Orders"},
{p:52, cost:"1349", label:"100,000 FBA Orders"},
.................................................................................................................................................................................................................................''''..............'''''..................''''''''''''''''...'''''''''''''''''......''''''...............'''''''''''''''''''''....'.........................'''''''''''''''''''''''''''''''''''''''''''''....''''.......................................................................................................................................................................................................................................................................................................................................'''''''''''''''''''''''''''''',,,,,,,,,,
...............................................................................................................................................................................................................................