Skip to content

Instantly share code, notes, and snippets.

View jdevera's full-sized avatar

Jacobo de Vera jdevera

View GitHub Profile
@jdevera
jdevera / idf-rm-user.php
Created February 20, 2010 22:56
Delete a user from InDefero
#!/usr/bin/env php
<?php
#
# Delete a user from InDefero.
# Run from the command line and pass a user ID as a parameter.
#
require '/home/www/indefero/src/IDF/conf/path.php';
require 'Pluf.php';
Pluf::start('/home/www/indefero/src/IDF/conf/idf.php');
Pluf_Dispatcher::loadControllers(Pluf::f('idf_views'));
@jdevera
jdevera / ecs.py
Created February 26, 2010 16:24
A replacement for pyaws's ecs.py to make it work with signed requests.
# Author: Kun Xi <[email protected]>
# License: Python Software Foundation License
#
# Note: This version, 0.3.1, supports the signed requests required
# by Amazon.
# The changes over 0.3.0 are based on a patch for 0.2.0 found here:
# http://blog.umlungu.co.uk/blog/2009/jul/12/pyaws-adding-request-authentication
# To make it work, just download pyaws from http://trac2.assembla.com/pyaws
# and replace the ecs.py file with this one.
@jdevera
jdevera / abspath.py
Created April 20, 2010 18:39
Abspath
#!/usr/bin/python
import os.path
import sys
if len(sys.argv) > 1:
if os.path.exists(sys.argv[1]):
print os.path.abspath(sys.argv[1])
@jdevera
jdevera / rename-pics.py
Created November 30, 2010 22:09
Rename image files depending on the camera that created them.
#!/usr/bin/env python
# Copyright (c) 2010 Jacobo de Vera
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@jdevera
jdevera / transitional.html
Created February 22, 2011 08:37
XHTML 1.0 Transitional Basic Template
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<title>Title Here</title>
@jdevera
jdevera / screenutils.py
Created April 8, 2011 09:33 — forked from Christophe31/screenutils.py
Gnu screen handling in python
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# Now this lib is on her own full repository and pypi page:
# http://github.com/Christophe31/screenutils
# http://pypi.python.org/pypi/screenutils
#
# This may not work with bpython, use python 2.6 or upper
#
# This program is free software. It comes without any warranty, to
@jdevera
jdevera / bashmarks.sh
Created July 11, 2011 16:32
Bookmarking directories in bash
# Originally from: https://github.com/twerth/dotfiles
# Bashmarks is a simple set of bash functions that allows you to bookmark
# folders in the command-line.
#
# To install, put bashmarks.sh somewhere such as ~/bin, then source it
# in your .bashrc file (or other bash startup file):
# source ~/bin/bashmarks.sh
#
# To bookmark a folder, simply go to that folder, then bookmark it like so:
# bookmark foo
@jdevera
jdevera / README.mkd
Created July 22, 2011 15:09
An Unball script for vimballs
@jdevera
jdevera / showmarks.vba
Created August 4, 2011 08:35
A vimball for showmarks, the self destroying vim addon
" Vimball Archiver by Charles E. Campbell, Jr., Ph.D.
UseVimball
finish
plugin/showmarks.vim [[[1
507
" ==============================================================================
" Name: ShowMarks
" Description: Visually displays the location of marks.
" Authors: Anthony Kruize <[email protected]>
" Michael Geddes <[email protected]>
@jdevera
jdevera / print_test.py
Created October 17, 2011 10:52
Python Testcase printing decorator
def print_doc(f):
"""
Prints the class and method name, followed by the first paragraph of the docstring.
This is intended to be used as a decorator
"""
def get_first_paragrap_in_single_line(doc):
lines = [ l.strip() for l in doc.strip().split('\n') ]
if '' in lines:
lines = lines[:lines.index('')]