Skip to content

Instantly share code, notes, and snippets.

View Endeios's full-sized avatar
🦁

Bruno Veronesi Endeios

🦁
View GitHub Profile
@Endeios
Endeios / csv_split.py
Created June 4, 2023 09:15
Csv split field with regex, in python
import re
pattern = re.compile(r',(?=(?:[^"]*"[^"]*")*[^"]*$)')
with open("./test.csv", "r") as csv_file:
for line in csv_file.readlines():
split_line = re.split(pattern, line)
print("%s | %s | %s" % (split_line[0], split_line[1], split_line[2],))
@Endeios
Endeios / baby.bat
Last active November 21, 2019 09:36
executor for gradle and babysteps for windows cmd
call gradle test
IF NOT ERRORLEVEL 1 (
Echo "Test passes-> committing"
call git add --all
call git commit -m"Baby Steps"
) ELSE (
Echo "Test failed-> resetting"
call git reset --hard
)
@Endeios
Endeios / bigDec.groovy
Last active April 27, 2017 13:27
Simplest ever helper for BigDecimals
import static java.math.BigDecimal.ROUND_HALF_UP; //this is the "normal rounding technique: if more than 5 round up, else round down
import java.math.BigDecimal; //Because jave does not have BigDecimals in env like Groovy
BigDecimal ten = new BigDecimal("10")
BigDecimal four = new BigDecimal("4")
int numberOfDecimals = 2
ten.divide(four,numberOfDecimals,ROUND_HALF_UP)
@Endeios
Endeios / loader.groovy
Created October 11, 2015 09:08
Loading and saving properties with groovy
@Grab('log4j:log4j:1.2.17')
import org.apache.log4j.*
import groovy.util.logging.*
log = Logger.getLogger(this.class)
log.level=Level.DEBUG
log.debug("="*100)
file = new File('props.groovy')
log.debug("File ${file}: ${file.exists()}")
http://www.astraownersclub.com/vb/showthread.php/590351-Complete-list-of-Astra-H-Zafira-B-diesel-fault-codes
Complete list of Astra H / Zafira B diesel fault codes
*****Could a Mod Please make this a Sticky in this section (Diesel engines) Thanks. ********
Find below a list of Astra H Diesel fault codes by engine code.
Firstly either do the pedal test or use a diagnostic scanner to retrieve the code.
To do the pedal test, use the following instructions
@Endeios
Endeios / bare-gui.groovy
Created April 4, 2015 12:11
Barebones groovy gui, ready for copy&paste
import java.awt.event.WindowAdapter
import java.awt.event.WindowEvent
import java.awt.BorderLayout as BL
import groovy.swing.SwingBuilder
import java.awt.Color
import java.awt.Desktop
import javax.swing.WindowConstants as WC
import javax.swing.BorderFactory as BF
import javax.swing.JOptionPane
import javax.swing.JFrame
@Endeios
Endeios / youaccess.vbs
Last active August 29, 2015 14:18
Youaccess is a clever script that helps ton in migrating old access databases to new options Can run under wine. You can find the original under http://youaccess.sourceforge.net
' -----------------------------------------------------------------------------
' License: let's say I put the thing in the thing so called "public domain"... |
' It is like a stone, can be used for the next silliness |
' or can be used to build your home, |
' but software is more a kind of metaphysical thing I'm not responsible of.... |
' -----------------------------------------------------------------------------
' NOTE: remember that for createobject created objects we've a utility for method and property inspection called OLE/COM object viewer, with MSDEV package, -> Open All Objects Explorer -> Open The Object [f.e: DAO.DBEngine.36] -> Click on _interface (f.e: _DBEngine) -> Click on View Type Info -> Open Methods explorer, for example, and enjoy...
' minor issue: WScript bug: seems not possible to pass a escaped " to argument in double quotes: "a \" b" is not readed correctly using wscript.arguments. Even when \" is the correct way to es
@Grapes(
@Grab(group='uk.co.caprica', module='vlcj', version='3.0.1')
)
//JNA resolvers: vlcj uses this
import com.sun.jna.Platform
import com.sun.jna.NativeLibrary
//swing things are made of theese...
import java.awt.BorderLayout as BL
@Endeios
Endeios / build.gradle
Created November 6, 2014 12:58
my base gradle build
// Apply the java plugin to add support for Java,groovy,and application
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'application'
project.group = "io.endeios"
project.version = "1.0.0"
mainClassName = "io.endeios.Run"
@Endeios
Endeios / addSlashes
Last active August 29, 2015 14:06
adds slashes to "special" character, for use when your div.id contains any of \, : , ?, @, &, =, +, $ . note that the chars are legal in id for html5 but needs escaping!
(function(){
var root = this;
//NOTE! \ must be the first one! o you double all slashes
var slashable = ['\\',':','?','@','&','=','+','$']
var addSlashes = function(str){
var max = slashable.length;
for(var i =0; i< max; i++){