Skip to content

Instantly share code, notes, and snippets.

@jeremiahmarks
jeremiahmarks / salesforceui.js
Created March 2, 2016 17:13
salesforceui.js
// ==UserScript==
// @name SalesForce UI enhancements
// @namespace http://www.paymill.com
// @version 0.6
// @description SalesForce UI enhancements
// @match *.salesforce.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant GM_addStyle
@jeremiahmarks
jeremiahmarks / recursivedefaultdict.py
Created January 22, 2016 13:44
recursive defaultdict
from collections import defaultdict
mydict=lambda:defaultdict(l)
recursiveDefDict = mydict()
import socket
playing = True
def recieveMessage():
print "hi!"
data = s.recv(512).decode()
if data == "Greetings\n":
print("Welcome to the number guessing game.")
import select
import socket
import random
import ssl
sockList = []
playing = False
guesses = 0
guess = 0
@jeremiahmarks
jeremiahmarks / adjustableFields.py
Last active November 24, 2015 13:23 — forked from doobeh/example.html
Checkbox WTForms Example (in Flask) - uses fields that are generated on the fly
from flask import Flask, render_template
from flask.ext.wtf import Form, widgets, SelectMultipleField
SECRET_KEY = 'development'
app = Flask(__name__)
app.config.from_object(__name__)
class MultiCheckboxField(SelectMultipleField):
widget = widgets.ListWidget(prefix_label=False)
{% extends 'base.html' %}
{% import 'macros.html' as macros %}
{% block content %}
<div class="row">
<div class="col-xs-12 col-md-3 col-sm-4 col-sm-offset-4 col-md-offset-4 col-lg-3 col-lg-offset-4">
<div class="login-message">
Login to AwesomeService!
</div>
{% call macros.render_form(form, action_url=url_for('login_view'), action_text='Login',
class_='login-form') %}
@jeremiahmarks
jeremiahmarks / symlink.sh
Last active November 18, 2015 04:01
Quick description of creating symlinks with gitbash on windows
$returnFields = array('Email', 'EmailAddress2', 'EmailAddress3');
$conDat = $app->loadCon(41, $returnFields);
/*sorry I do not PHP, but you would want to loop through all of the returned addresses
and then opt each out ont, something like in sudo code*/
for eachemailaddress in $conDat:
$app->optOut(eachemailaddress,"Why they opted out");
;; This gives an introduction to Emacs Lisp in 15 minutes (v0.2d)
;;
;; Author: Bastien / @bzg2 / http://bzg.fr
;;
;; First make sure you read this text by Peter Norvig:
;; http://norvig.com/21-days.html
;;
;; Then install GNU Emacs 24.3:
;;
;; Debian: apt-get install emacs (or see your distro instructions)
@jeremiahmarks
jeremiahmarks / pullactivities.py
Last active November 12, 2015 23:53
Move all of a specific XML tag its own folder.
import xml.etree.ElementTree as ET
import Tkinter as tk
import tkFileDialog
tk.Tk().withdraw()
import os
def getFilePath(titletext="Please select a file"):
return tkFileDialog.askopenfilename(title=titletext)