Skip to content

Instantly share code, notes, and snippets.

View simahawk's full-sized avatar

Simone Orsi simahawk

View GitHub Profile
# ~/.gitconfig
[branch]
autosetupmerge = true
[push]
default = current
[core]
excludesfile = .gitignore
"""
Use with
bin/instance run export_skin_folder.py
This script will extract the portal_skins folder
named in SKINFODLER_NAME to the DEST directory
"""
import os
import sys
PLONE_PORTAL = 'Plone'
@simahawk
simahawk / reflect.py
Created June 13, 2016 10:14 — forked from huyng/reflect.py
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@simahawk
simahawk / README.md
Created February 11, 2017 13:31 — forked from magnetikonline/README.md
Minimum Open Graph tags required for a webpage - for use with Facebook.

Open Graph tags for page <head>.

<meta property="og:title" content="title" />
<meta property="og:description" content="desc" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://url.com/" />
<meta property="og:image" content="http://url.com/image.jpg" />
@simahawk
simahawk / README.md
Created February 11, 2017 13:31 — forked from magnetikonline/README.md
Minimum Open Graph tags required for a webpage - for use with Facebook.

Open Graph tags for page <head>.

<meta property="og:title" content="title" />
<meta property="og:description" content="desc" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://url.com/" />
<meta property="og:image" content="http://url.com/image.jpg" />
@simahawk
simahawk / remove-docker-containers.md
Created November 21, 2017 09:53 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm
    

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images
@simahawk
simahawk / csv2xml4odoo.py
Created March 9, 2020 08:57 — forked from bealdav/csv2xml4odoo.py
Odoo csv / xml converter
# -*- coding: utf-8 -*-
# based on this code
# http://code.activestate.com/recipes/577423-convert-csv-to-xml/
# convert Odoo csv files in xml files
# csv is easy to maintain but xml data have noupdate feature
# Limitations:
# - relation field One2many is NOT supported
# - csv should have 'id' as first column