Skip to content

Instantly share code, notes, and snippets.

Avatar

Laurent Zubiaur lzubiaur

View GitHub Profile
@lzubiaur
lzubiaur / remove_tags.py
Created Nov 4, 2015
Remove xml/html tags from a file
View remove_tags.py
#!/usr/bin/env python
# coding=utf-8
import re
import sys
with open(sys.argv[1], 'r') as _in, open(sys.argv[2], 'w') as _out:
for line in _in:
line = re.sub('<.[^>]*>', '', line)
_out.write(line)
@lzubiaur
lzubiaur / ConsoleCommands.cpp
Last active Aug 29, 2015
Custom Cocos2d-x console commands (run remote lua script...)
View ConsoleCommands.cpp
/****************************************************************************
Copyright (c) 2013-2015 Laurent Zubiaur.
http://voodoocactus.com
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
@lzubiaur
lzubiaur / custommenusprite.cpp
Created Mar 24, 2014
Custom cocos2dx menu item
View custommenusprite.cpp
/**
* Copyright (C) 2012-2014 Laurent Zubiaur - pix2d.com
*
* 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:
*
@lzubiaur
lzubiaur / svgexport.py
Last active Feb 5, 2018
Batch export for Inkscape
View svgexport.py
#!/usr/bin/env python
# -*- coding: latin-1 -*-
"""
svgexport.py - Batch export for Inkscape - Laurent Zubiaur
description:
Python script that can be used to automate batch exports of Inkscape objects by providing their id (set in the Object Properties dialog).
Also useful to batch export with a specific dpi (only available for individual object export in GUI mode).
For all available inkscape command line options see http://inkscape.org/doc/inkscape-man.html.
@lzubiaur
lzubiaur / notification.lua
Last active Mar 24, 2018
Lua Notification Center (cocos2dx)
View notification.lua
--[[
Why this package?
Cocos2d-x CCNotificationCenter is limited to one lua function callback (observer) per target (CCObject).
This simple Lua script wraps CCNotificationCenter and allows code like:
addObserver(foo,'eventname')
addObserver(foo2,'eventname')
]]--
-- The NotificationCenter (nc) table
local nc = {