Skip to content

Instantly share code, notes, and snippets.

View lzubiaur's full-sized avatar
🏠
Working from home

Laurent Zubiaur lzubiaur

🏠
Working from home
  • Tokyo, Japan
View GitHub Profile
@lzubiaur
lzubiaur / remove_tags.py
Created November 4, 2015 20:23
Remove xml/html tags from a file
#!/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 August 29, 2015 14:13
Custom Cocos2d-x console commands (run remote lua script...)
/****************************************************************************
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 March 24, 2014 06:09
Custom cocos2dx menu item
/**
* 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 February 5, 2018 10:47
Batch export for Inkscape
#!/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 March 24, 2018 12:34
Lua Notification Center (cocos2dx)
--[[
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 = {