Skip to content

Instantly share code, notes, and snippets.

@Gazzell
Gazzell / update_chrome_driver.sh
Created June 10, 2020 09:03
updates chromedriver to latest version
LATEST_VERSION=$(curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE) && wget -O /tmp/chromedriver.zip https://chromedriver.storage.googleapis.com/$LATEST_VERSION/chromedriver_linux64.zip && sudo unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/;
function firePointerEvent(el, eventName, x,y){
const ev = new MouseEvent(eventName, {
clientX: x, clientY: y, bubbles: true, cancelable: true
});
el.dispatchEvent(ev);
}
var relativePosition = APP.getNodePositionAsOffset("cards.ticket1.emptyTicket.buttonAdd")
var canvas = document.getElementsByTagName("canvas")[0];
@Gazzell
Gazzell / .eslintrc
Last active January 31, 2024 18:28
React, typescript, use craco to set custom tests paths and import aliases
{
"extends": [
"eslint-config-react-app"
],
"plugins": ["react", "import"],
"rules": {
"import/no-unresolved": "error"
},
"settings": {
"import/parsers": {
@Gazzell
Gazzell / printHierarchy.js
Created January 28, 2020 12:36
print PIXI hierarchy
function printHierarchy(node, padding="") {
let newPadding = padding;
if (node.name) {
newPadding += " |";
console.log(`${padding}-${node.name}`);
}
node.children.forEach(child => printHierarchy(child, newPadding));
}
@Gazzell
Gazzell / draw_crosshair.js
Last active April 17, 2020 08:22
show PIXI hit areas
class Crosshair {
constructor(size = 3, color = "red") {
this.element = document.createElement("span");
this.element.textContent = "+";
this.style = this.element.style;
this.style.color = color;
this.style.fontFamily = "Arial";
this.style.fontSize = `${size}em`;
this.style.fontWeight = "";
@Gazzell
Gazzell / commands.txt
Last active March 16, 2020 09:24
useful bash commands
# delete node_modules for in all projects (dirs)
find ./ -name "node_modules" -maxdepth 2 -exec rm -rf {} \;
##GIT
#remove all merged local branches
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d
@Gazzell
Gazzell / index.html
Created January 21, 2019 14:33
Waves
<canvas id='canvas' width='400' height='400'></canvas>
@Gazzell
Gazzell / index.html
Last active December 13, 2018 08:14
Maze
<canvas id='canvas' width='800' height='800'></canvas>
@Gazzell
Gazzell / viewHierarchy
Last active January 31, 2018 16:54
prints pixi.js node hierarchy in console (assuming nodes has 'name' property)
function printHierarchy(node, padding="") {
let newPadding = padding;
if (node.name) {
newPadding += " |";
console.log(`${padding}-${node.name}`);
}
node.children.forEach(child => printHierarchy(child, newPadding));
}