Skip to content

Instantly share code, notes, and snippets.

@jeremiahmarks
jeremiahmarks / Notes for asteroid field
Created September 18, 2017 16:04
Notes for asteroid field
How to log into codesters
Go to http://codesters.com
Click on the "Log In" Button
Log in using code f7b3de
Select your name from the list
use the password that is on the other side of your nametag to log in.
Take a gander at the game we are going to build:
til.la/afield
CREATE TRIGGER update_appInfo_updatetime BEFORE update ON appInfo
begin
update appinfo set updatedatetime = strftime('%Y-%m-%d %H:%M:%S:%s','now', 'localtime') where bundle_id = old.bundle_id;
end
CREATE TABLE "appInfo" (bundle_id INTEGER PRIMARY KEY,title text, updatedatetime text DEFAULT (strftime('%Y-%m-%d %H:%M:%S:%s','now', 'localtime')))
import math
def getEntropy(somestring):
baseent=0.0
lettersinthing=set(somestring)
for eachletter in lettersinthing:
letent = somestring.count(eachletter)/float(len(somestring))
letent=letent*math.log(letent, 2)
baseent+=letent
return -1*baseent
@jeremiahmarks
jeremiahmarks / tagfix.py
Last active April 4, 2016 15:53
fixes tag id spacing in Contact Export files from Infusionsoft
# -*- coding: utf-8 -*-
# @Author: jeremiah.marks
# @Date: 2016-03-30 10:40:17
# @Last Modified by: Jeremiah Marks
# @Last Modified time: 2016-03-30 11:06:29
import csv
import os
import Tkinter as tk
import tkFileDialog
@jeremiahmarks
jeremiahmarks / index.py
Created March 22, 2016 17:51
optoutform
#!/usr/local/bin/python2.7
import cgi
import cgitb
cgitb.enable()
import xmlrpclib
class infusCon:
def __init__(self, appname, apikey):
{"maps":{"idOthers":{"label":"Others","state":1,"bkmrk":{}}},"portals":{"idOthers":{"label":"Others","state":1,"bkmrk":{"id1458254307551":{"guid":"890f7f05ac124875a2f5968bcd25add9.16","latlng":"33.480969,-111.680844","label":"Las Sendas Waterfall"},"id1458254316309":{"guid":"bfc4e213823f413f9a1804f02d34e9c0.16","latlng":"33.483431,-111.679085","label":"Paul Robinson"},"id1458254323980":{"guid":"7d42911743d640b8b77a1c3d949218ac.16","latlng":"33.48394,-111.679812","label":"Harriet Tubman Children's Park"},"id1458254327569":{"guid":"95402e9fbf1245f98ba6efe9e3d5b978.16","latlng":"33.484634,-111.679436","label":"Women Pioneer Statue "},"id1458254332139":{"guid":"711a3aa39d0e430ea3873b8cac723ce8.16","latlng":"33.484875,-111.679884","label":"Tonto Verde Trail"},"id1458254365165":{"guid":"2f69889c18df4711a7832f9cd5a60647.16","latlng":"33.487686,-111.663148","label":"Mt. Las Sendas"},"id1458254389016":{"guid":"e35564ac2eba42a48b71c5528e77a8f6.16","latlng":"33.486678,-111.661482","label":"Trailhead Members Club"},"id14
@jeremiahmarks
jeremiahmarks / linkcons.py
Created March 11, 2016 18:18
Link contacts to companies in Infusionsoft based on data in a csv file.
# @Author: jeremiah.marks
# @Date: 2016-03-11 10:43:53
# @Last Modified by: jeremiah.marks
# @Last Modified time: 2016-03-11 11:17:56
# This script will process a csv which contains an FKID
# column and a companyId column and assign the contacts
# to the correct company.
# These variables will be determined by the names the columns
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Jeremiah Marks
# @Date: 2015-08-20
# @Last Modified
# @Last Modified 2015-09-22
import os
import sys
import csv
import sys
sys.path.append('C:\Users\jeremiah.marks\Documents\GitHub\csvToolbox')
sys.path.append('C:\Users\jeremiah.marks\Documents\GitHub\maxgress')
pw={}
pw['username'] = 'jeremiah.marks@infusionsoft.com'
pw['password']='asdf'
@jeremiahmarks
jeremiahmarks / apitests.py
Created March 8, 2016 08:41
Automagically get a key when needed
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Jeremiah Marks
# @Date: 2015-08-20
# @Last Modified
# @Last Modified 2015-09-22
import ISServer_master as ISServer
from bs4 import BeautifulSoup
from robobrowser import RoboBrowser