Skip to content

Instantly share code, notes, and snippets.

Jonas jonasvp

Block or report user

Report or block jonasvp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am jonasvp on github.
  • I am jonasvp (https://keybase.io/jonasvp) on keybase.
  • I have a public key ASA7qVGmSQIT31YAbXu9OFjPGm-dIpcop6YZhQPPvlAwaQo

To claim this, I am signing this object:

@jonasvp
jonasvp / show.html.erb
Last active Oct 13, 2015
Integrate Harvest Platform into redmine
View show.html.erb
<div style="position:absolute;left:1230px;" class="harvest-timer" data-project='{"id":"<%= @project.id %>", "name": "<%=j @project.name %>"}' data-item='{"id": "<%= @issue.id %>", "name":"<%=j @issue.subject %>"'></div>
<script>
(function() {
window._harvestPlatformConfig = {
"applicationName": "Redmine",
"permalink": "https://YOUR.REDMINE.DOMAIN/issues/%ITEM_ID%"
};
var s = document.createElement('script');
s.src = '//platform.harvestapp.com/assets/platform.js';
s.async = true;
@jonasvp
jonasvp / harvest_monthly_budgets.py
Created Nov 1, 2011
Monthly budgets for harvest: cronjob for rotating projects
View harvest_monthly_budgets.py
#!/usr/bin/env python
'''
Harvest (www.getharvest.com) does not support setting monthly budgets for projects.
The recommended workaround is creating a new project every month. This script is
supposed to run on the first of every month and uses the Harvest API in order to
archive last month's projects and create new ones for the current month. Members
and tasks are automatically copied over to the new project.
Projects with monthly budgets need to fulfill two requirements:
1. They need to have a budget set
@jonasvp
jonasvp / pre-commit
Created Mar 7, 2011
My .git/hooks/pre-commit - save yourself from embarassment using pyflakes
View pre-commit
#!/bin/bash
TMPDIR=`mktemp -d`
TMPFILE=`mktemp`
git diff --cached --name-only --diff-filter=ACMR | xargs git checkout-index --prefix=$TMPDIR/ --
pyflakes $TMPDIR >$TMPFILE 2>&1
grep -v "unable to detect undefined names" $TMPFILE >$TMPFILE.2
egrep -v "migrations.*'(datetime|models)' imported but unused" $TMPFILE.2 >$TMPFILE
grep -rn "pdb.set_trace" $TMPDIR >>$TMPFILE
sed "s/^${TMPDIR//\//.}.//" $TMPFILE >$TMPFILE.2
You can’t perform that action at this time.