Skip to content

Instantly share code, notes, and snippets.

View gsomoza's full-sized avatar

Gabriel Somoza gsomoza

View GitHub Profile
@gsomoza
gsomoza / durations.js
Created February 15, 2024 14:27
Jenkins Job Total Durations
/*
* Run this on the Blue Ocean activity page to add up all job durations visible on that page.
*/
(function(){
const durations = [...document.querySelectorAll('[data-runid] a:nth-of-type(5) span')].map(i => i.textContent);
console.log(durations);
const validDurations = durations.filter(duration => !duration.startsWith("<"));
find . -type f -name "*Test.php" -exec sed -i '' s/@cover/c_over/g {} +
find . -type f -name "*Test.php" -exec sed -i '' s/@use/u_se/g {} +
@gsomoza
gsomoza / p2-test.js
Last active February 14, 2019 08:37 — forked from damian-pastorini/P2JS
My first P2 impact test code....
this.p2world.on('impact', function(evt){
var playerBody,
currentPlayer = this.state.players[client.sessionId];
console.log('Body positions: ', evt.bodyA.position, evt.bodyB.position);
if (evt.bodyA.hasOwnProperty('playerId')) {
playerBody = evt.bodyA;
} else if (evt.bodyB.hasOwnProperty('playerId')) {
playerBody = evt.bodyB;
@gsomoza
gsomoza / PATCH_SUPEE-9767_EE_1.12.0.2_v2-2017-07-11-11-08-20.sh
Last active July 19, 2017 14:09
SUPEE-9767 fixed for EE 1.12.0.2 (the officially distributed version didn't work for us)
#!/bin/bash
# Patch apllying tool template
# v0.1.2
# (c) Copyright 2013. Magento Inc.
#
# DO NOT CHANGE ANY LINE IN THIS FILE.
# 1. Check required system tools
_check_installed_tools() {
local missed=""
<?php
interface RequestAuthorizer
{
public function __construct(AccessToken $accessToken);
public function isAuthorized(RequestInterface $request): bool;
public function authorize(RequestInterface $request): void;
}
class AccessTokenMiddleware
@gsomoza
gsomoza / s3-presign-url.py
Last active August 6, 2018 12:45
S3: Create Presigned Download URL
#!/usr/bin/env python
# Usage:
# s3-presign-url path/to/object
#
# 1) Install boto3:
# pip install boto3
# 2) Configure aws:
# aws configure
# 3) Change the bucket name in this script (below)
@gsomoza
gsomoza / ztvpn.sh
Last active September 28, 2020 04:17
ZeroTier VPN Switch Script
#!/bin/bash
ZT_NETWORK="NETWORK_ID"
# colors
RCol='\033[0m' # Text Reset
LGra='\033[0;37m';
Red='\033[0;31m';
Gre='\033[0;32m';
Yel='\033[0;33m';
@gsomoza
gsomoza / gist:be935827f23e98e1218064fc2c34b256
Created September 9, 2016 13:31
Slim Magento 1 DB Dump
mysqldump --no-data -h localhost -u root -p schema | gzip > structure.sql.gz
mysqldump --no-create-info -h localhost -u root -p
--ignore-table=schema.adminnotification_inbox \
--ignore-table=schema.aw_core_logger \
--ignore-table=schema.dataflow_batch_export \
--ignore-table=schema.dataflow_batch_import \
--ignore-table=schema.log_customer \
--ignore-table=schema.log_quote \
--ignore-table=schema.log_summary \
--ignore-table=schema.log_summary_type \
Verifying that +somoza is my blockchain ID. https://onename.com/somoza
@gsomoza
gsomoza / v20151009133517_AddStaticRoute.php
Created October 17, 2015 14:14
Pimcore Migrations Samples
<?php
namespace Migrations;
use Pimcore\Migrations\Migration\AbstractMigration;
use Pimcore\Model\Staticroute;
/**
* Migration v20151009133517_AddStaticRoute
* @author Gabriel Somoza <gabriel@somoza.me>
*/