Skip to content

Instantly share code, notes, and snippets.

@abondis
abondis / csvtoics_tasks.py
Created September 9, 2022 17:32
quick csv to ics tasks
import csv
import datetime
tpl = """BEGIN:VCALENDAR
BEGIN:VTODO
SUMMARY:{summary}
DUE;TZID=America/Toronto:{due}T000001
CLASS:PRIVATE
END:VTODO
END:VCALENDAR"""
@abondis
abondis / keybase.md
Created December 1, 2017 03:22
keybase.md

Keybase proof

I hereby claim:

  • I am abondis on github.
  • I am abondis (https://keybase.io/abondis) on keybase.
  • I have a public key ASD762t1Pnyk5EnGeKhbVWmbedxfZeFl2QJMqGgeqnp9BAo

To claim this, I am signing this object:

@abondis
abondis / example.yml
Created September 11, 2015 18:36
ansible multiline lineinfile
# SSH config
# Not the best, but should be enough for my needs
- name: add a marker to replace later
lineinfile:
insertafter: "{{ sftp_config[[0, item|int -1]|max] }}"
dest: /etc/ssh/sshd_config
line: "{{ sftp_config[item|int] }}"
with_sequence: start=0 count=4
@abondis
abondis / sh.py
Last active August 29, 2015 14:26
from subprocess import check_output, CalledProcessError
def call_me(cmd, *args, **kwargs):
cmd_list = [cmd]
def wrap(*args, **kwargs):
cmd_list.extend(args)
try:
return 0, check_output(cmd_list, **kwargs)
@abondis
abondis / mock Resource.py
Created December 4, 2014 23:14
mock flask.ext.restul.Resource heritance
from mock import MagicMock, patch
import sys
restful = MagicMock(autospec=True)
attrs = {'__init__': lambda *args, **kwargs: None}
bases = (object,)
Res = type('Resource', bases, attrs)
restful.Resource = Res
with patch.dict(

Keybase proof

I hereby claim:

  • I am abondis on github.
  • I am abondis (https://keybase.io/abondis) on keybase.
  • I have a public key whose fingerprint is F2D7 CE32 60DD 76AD EE38 49E3 5D23 DB88 4881 E759

To claim this, I am signing this object:

@abondis
abondis / .git_config
Created December 30, 2013 21:08
checkout non bare repo
[receive]
denyCurrentBranch = warn
@abondis
abondis / gist:4962393
Last active December 13, 2015 19:28
dulwich: move a file in a repo
from dulwich.repo import Repo
r = Repo('/tmp/bunchofrepos/montestgit/')
t = r['HEAD'].tree
T = r.tree(t)
truc_entry = T.lookup_path(r.get_object, 'blah/truc')
truc_tree = r.tree(truc_entry[1])
truc_tree.entries()
truc_tree['new_filename.txt'] = truc_tree['bidule.text']
truc_tree.entries()
del truc_tree['bidule.text']
@abondis
abondis / responsive.css
Created August 5, 2012 23:10
html + css
body {
width: 100%;
*zoom: 1; }
body:before, body:after {
content: "";
display: table; }
body:after {
clear: both; }
header#top {
@abondis
abondis / gist:3267637
Created August 5, 2012 22:48
semantic.gs menu
topmenu {
@include column(12);
float: right;
ul{
@include column(9);
float: right;
padding:0;
li {
@include column(1);
display: inline;