Skip to content

Instantly share code, notes, and snippets.

@tracymiranda
tracymiranda / cla-example.md
Last active October 17, 2023 14:54
CLA example

<> Individual Contributor License Agreement

In order to clarify the intellectual property license granted with Contributions from any person or entity, <>, ("Company") must have a Contributor License Agreement (“CLA”) on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of Company; it does not change your rights to use your own Contributions for any other purpose.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Company. Except for the license granted herein to Company and recipients of software distributed by Company, You reserve all right, title, and interest in and to Your Contributions.

  1. Definitions. “You” (or “Your”) shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Company. For legal entities, the entity making a Contribution and all other entitie
@tracymiranda
tracymiranda / autosave.py
Last active July 19, 2020 19:11
This script runs with Eclipse EASE Jython engine.It autosaves the current editor every 30 seconds or when the editor is deactivated.
# Before running this script you will need to turn on the 'Allow Scripts to run code in UI thread'
# setting by checking the box under Window>Preferences>Scripting.
# To run you can right click on the file and select Run As>EASE Script.
# A save message is printed out in the Console view every time an editor is saved.
# To turn off the autosave just stop the script for example, by pressing the
# 'Terminate' red square button in the Eclipse Console view.
import time
loadModule("/System/Platform")
loadModule("/System/UI")
@tracymiranda
tracymiranda / deleteProjects.py
Created February 10, 2016 13:50
This script runs with Eclipse EASE Jython engine. It deletes the projects created by the createProjects.py script
# name :Delete fruit projects
# toolbar : Project Explorer
# description : Get rid of the fruit projects
loadModule("/System/Resources")
for name in ["banana", "pineapple", "mango"]:
project = getProject(name)
project.delete(0, None)
@tracymiranda
tracymiranda / createProjects.py
Created February 10, 2016 13:49
This script runs with Eclipse EASE Jython engine. It creates four new projects.
# name : Create fruit projects
# toolbar : Project Explorer
# description : Create fruit projects
loadModule("/System/Resources")
for name in ["banana", "pineapple", "mango"]:
createProject(name)
@tracymiranda
tracymiranda / explorer.py
Created February 10, 2016 13:47
This script runs with Eclipse EASE Jython engine. It allows you to start a file browser using the current selection.
# name : Explore from here
# popup : enableFor(org.eclipse.core.resources.IResource)
# description : Start a file browser using current selection
loadModule("/System/Platform")
loadModule('/System/UI')
selection = getSelection()
if isinstance(selection, org.eclipse.jface.viewers.IStructuredSelection):
selection = selection.getFirstElement()
@tracymiranda
tracymiranda / add_readme.py
Created February 10, 2016 12:35
This script runs with Eclipse EASE Jython engine. It adds a README.md file to all open projects in the workspace, noting if they are a java or python project.
loadModule('/System/Resources')
for iproject in getWorkspace().getProjects():
if not iproject.isOpen():
continue
ifile = iproject.getFile("README.md")
if not ifile.exists():
contents = "# " + iproject.getName() + "\n\n"
@tracymiranda
tracymiranda / markers.py
Last active February 10, 2016 12:32
This script runs with Eclipse EASE Jython engine. It adds an Eclipse Task Marker for all printStackTrace lines it detects in java files in the workspace.
loadModule('/System/Resources')
from org.eclipse.core.resources import IMarker
for ifile in findFiles("*.java"):
file_name = str(ifile.getLocation())
print "Processing " + file_name
with open(file_name) as f:
for line_no, line in enumerate(f, start=1):
if "printStackTrace" in line: