Skip to content

Instantly share code, notes, and snippets.

@avierax
avierax / mythicaldoubleshein.md
Last active September 25, 2025 16:04
The mythical double shein.md

For every thing in google play store there's always a competitor that managed to put an ad on top of the best result.

For amazon, you get -> temu. For temu you get -> shein, ...and for shein, strange enough, you get -> shein.

Resulting in a double shein.

image
@avierax
avierax / gitmermaid.md
Created May 29, 2023 18:09
Example of mermaid
%%{init: { 'logLevel': 'debug', 'theme': 'base', 'gitGraph': {'showBranches': true, 'showCommitLabel':true,'mainBranchName': 'master'}} }%%
gitGraph
   commit
   commit
   branch subtask/PRO-2842
   checkout subtask/PRO-2842
   commit id: "structural change"
 checkout master
@avierax
avierax / convert.js
Created March 15, 2022 13:40
Small snippet to convert from WGS84 to EPSG 3857
console.log("foo")
// smRadius = 6378136.98
smRadius = 6378137
smRange = smRadius * Math.PI * 2.0
smLonToX = smRange / 360.0
smRadiansOverDegrees = Math.PI / 180.0
lon = -82.413797
// Algorithm to compute the full spanish style surnames from the last level of your genalogic tree
function bits(x,times){
result = 0;
for(var i=0;i<times;i++){
result = (result << 1) + (x % 2);
x = x >> 1;
}
return result;
}
@avierax
avierax / ClosureStackSample.java
Last active February 15, 2018 23:06
An example of stack made without variables and without defining a single class (and thus without fields)
package com.company;
import java.util.NoSuchElementException;
import java.util.function.Consumer;
public interface Main {
interface Stack<T> {
default Stack<T> push(T o){
return consumer -> {
/*
* Copyright (c) 2015 - 2017 by Appollo Systems GmbH,
* Michael-Breunig-Straße 22, D-63927 Bürgstadt. All rights reserved.
*/
package s.a.a.b.m.t;
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;

En el Reino de los Cielos no hay grandeza que conquistar, puesto que allá todo es jerarquía establecida, incógnita despejada, existir sin término, imposibilidad de sacrificio, reposo y deleite. Por ello, agobiado de penas y de tareas, hermoso dentro de su miseria, capaz de amar en medio de las plagas, el hombre solo puede hallar su grandeza, su máxima medida en el Reino de este mundo.

package com.tissca.gwttests;
import com.google.gwt.core.client.EntryPoint;
import elemental2.core.JsDate;
import elemental2.dom.*;
import org.gwtproject.storage.client.Storage;
import static elemental2.dom.DomGlobal.*;
/**
* Entry point classes define <code>onModuleLoad()</code>.
@avierax
avierax / WriteHandler.java
Created February 7, 2017 18:58
This is the snippet that intercepts the write message
if (operation instanceof VcsMessageWrite) {
VcsMessageWrite vcsOperationWrite = (VcsMessageWrite) operation;
if(vcsOperationWrite.getFilename().endsWith(".bpmn")){
decodeBpmnRpc(vcsOperationWrite);
}
return (T) VcsReplyRevision.create(vcsOperationWrite.getId(), RevisionDtoConverter.toRevisionDto(write(em, vcsOperationWrite.getProjectId(), vcsOperationWrite.getFilename(), vcsOperationWrite.getContent(), vcsOperationWrite.getExpectedVersion(), vcsOperationWrite.isForced()), includeContent));
}