Skip to content

Instantly share code, notes, and snippets.

View josuigoa's full-sized avatar

Josu Igoa josuigoa

View GitHub Profile
@josuigoa
josuigoa / Dockerfile
Created January 15, 2020 09:48
Dockerfile to get Haxe + HL linux environment. Used to build hl-extension project
FROM haxe:4.0.5-stretch
ENV HL_VERSION 1.10
RUN set -ex \
&& hlBuildDeps=' \
gcc \
make \
cmake \
libpng-dev \
@josuigoa
josuigoa / boleto_zenbakiak.py
Created November 29, 2017 15:52
boletoetan zenbakiak sartu eta automatikoki JPGak esportatzeko script-a
#! /usr/bin/env python
from gimpfu import *
import glob
from os import listdir
from os.path import isfile, isdir, join, splitext
import os
import sys
import string
def run(image, drawable, out_dir, boleto_kop, fontface, fontsize):
@josuigoa
josuigoa / scale_images.py
Last active June 12, 2018 07:57
Gimp plug-in to scale images recursively from a folder
#! /usr/bin/env python
from gimpfu import *
import glob
from os import listdir
from os.path import isfile, isdir, join, splitext
import os
import sys
import time
import datetime
@josuigoa
josuigoa / labur.js
Last active May 31, 2017 10:04 — forked from aldakur/labur.js
labur
jQuery(document).ready(function($) {
jQuery("#button_polr_get_url").click(function(){
var doc_pathname = '';
var url = document.location.protocol + '//' + document.location.host + MyAjax.ajax_path;
jQuery.ajax({
type: 'POST',
url: url,
dataType: 'text',
@josuigoa
josuigoa / AE.hx
Last active October 26, 2017 11:19
Adierazpen erregularrak
class AE {
static public inline var lerro_saltoa = ~/\r?\n/g;
static public inline var zuriunea = ~/[\t|\s]+/g;
// ONARTUAK: 1985/08/21 / 1982/2/24 / 2013/12/3
// EZ ONARTUAK: 1/3/14 / 01/09/16 / 21/08/1958
// data_osoa = data.matched(0); // 1985/08/21
// urtea = data.matched(1); // 1985
// hilabetea = data.matched(2); // 08
@josuigoa
josuigoa / MacroJsonValidator.hx
Last active March 28, 2017 16:06 — forked from markknol/MacroJsonValidator.hx
Macro - validate a JSON compiletime
/**
* @author Mark Knol
*/
class MacroJsonValidator {
public static macro function validateJson(path:String) {
if (sys.FileSystem.exists(path)) {
var content = sys.io.File.getContent(path);
try {
// Test the json by parsing it.
// It will throw an error when you made a mistake.
@josuigoa
josuigoa / layers_to_jpg_export.py
Created February 7, 2017 07:47
Gimp plugin to export the layers to JPG images
#! /usr/bin/env python
from gimpfu import *
import glob
from os import listdir
import os
import time
import datetime
def run(timg, tdrawable):
ts = time.time()
@josuigoa
josuigoa / Main.hx
Last active May 22, 2018 09:47
Macro to extract the selectors (id, class, tag) from a html file
package;
import Selectors;
class Main {
static function main() {
Cls.akatsa.jq().fadeOut();
Id.eszena.jq().addClass(Cls.ezkutua);
@josuigoa
josuigoa / LibraryParser.hx
Last active October 20, 2016 13:27
This macro saves the libraries versions used in the current build in a file. If the lib is a git repo, you get the commit hashes and the commit message.
package macros;
using StringTools;
typedef LibVer = {
var name:String;
var version:String;
}
class LibraryParser {
@josuigoa
josuigoa / Main.hx
Created September 27, 2016 13:12
This macro reads the given directory and creates a class with the paths of the resources in it recursively. The class name and resources extensions are customizable
package;
@:build(macros.ResourceBuilder.build('../img/', ['jpg', 'png', 'bmp'], 'Img', 'img/'))
@:build(macros.ResourceBuilder.build('../snd/', ['mp3', 'ogg'], 'Snd', 'snd/'))
class Main {
public function new() {
trace( Img.irudia__png );
trace( Snd.abestia__mp3 );