Skip to content

Instantly share code, notes, and snippets.

View Alzy's full-sized avatar
👷‍♂️
_hi

Alfredo Gonzalez-Martinez Alzy

👷‍♂️
_hi
  • 1646.ca / StemLink.net
  • Reseda, CA
View GitHub Profile
@Alzy
Alzy / deforum_stable_diffusion.ipynb
Last active October 8, 2022 07:25
Deforum_Stable_Diffusion.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#################################################################
## Iro
################################################################
##
## * Press Ctrl + '+'/'-' To Zoom in
## * Press Ctrl + S to save and recalculate...
## * Documents are saved to web storage.
## * Only one save slot supported.
## * Matches cannot span lines.
## * Unicode chars must be defined in \u0000 to \uffff format.
@Alzy
Alzy / getBrightnessCompliment
Created March 28, 2019 02:22
Given a hex color, return "black" or "white" depending on brightness. For use when you need to determine the right label color over a known color.
<!DOCTYPE html><html><head><title>COLOR COMPLIMENT</title></head><body><script type="text/javascript">
function hexToRgb(hex) {
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex)
return (result ? {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : null)
@Alzy
Alzy / export-magento-products-to-google-merchant-sheet.php
Last active January 18, 2019 21:14
This php script exports magento products to a custom google sheet to be used with google merchant. NOTE: requires a attribute to be added to magento products called "in_google_merchant_feed" which resolves to either true or false.
<?php
require(__DIR__ . '/../vendor/autoload.php');
require "../app/Mage.php";
umask(0);
Mage::app();
header("Content-type: text/plain");
if (php_sapi_name() != 'cli') {
throw new Exception('This application must be run on the command line.');
}
@Alzy
Alzy / export-magento-products-to-google-merchant-sheet
Created January 18, 2019 21:12
This php script exports magento products to a google sheet to be used with google merchant.
<?php
require(__DIR__ . '/../vendor/autoload.php');
require "../app/Mage.php";
umask(0);
Mage::app();
header("Content-type: text/plain");
if (php_sapi_name() != 'cli') {
throw new Exception('This application must be run on the command line.');
}
@Alzy
Alzy / CPU speed test
Last active March 22, 2018 08:34
Aaron Becker's method of measuring/guessing client's cpu speed
// https://stackoverflow.com/questions/15464896/get-cpu-gpu-memory-information/42143572#42143572
// https://stackoverflow.com/users/6179827/aaron-becker
var _speedconstant = 8.9997e-9; //if speed=(c*a)/t, then constant=(s*t)/a and time=(a*c)/s
var d = new Date();
var amount = 150000000;
var estprocessor = 1.7; //average processor speed, in GHZ
console.log("JSBenchmark by Aaron Becker, running loop "+amount+" times. Estimated time (for "+estprocessor+"ghz processor) is "+(Math.round(((_speedconstant*amount)/estprocessor)*100)/100)+"s");
for (var i = amount; i>0; i--) {}
var newd = new Date();
@Alzy
Alzy / singleKeyCopyPaste.ahk
Created March 19, 2018 20:38
AutoHotKey script to key bind copy/paste to single keys
RAlt::^c
RCtrl::^v
@Alzy
Alzy / Magento get common URLs (ver 1.x) Magento How to get the customer login, logout, register and checkout urls
login url
<?php echo Mage::getUrl('customer/account/login'); ?>
logout url
<?php echo Mage::getUrl('customer/account/logout'); ?>
My Account url
<?php echo Mage::getUrl('customer/account'); ?>
Register url