Skip to content

Instantly share code, notes, and snippets.

View rootindex's full-sized avatar

rootindex rootindex

  • Silvertree
  • Cape Town
View GitHub Profile
$newsFromDate = Mage::getResourceModel('catalog/product')
->getAttributeRawValue($product->getId(), 'news_from_date', $product->getStoreId());
UPDATE cataloginventory_stock_item AS s
INNER JOIN catalog_product_entity AS p ON s.product_id = p.entity_id
SET s.qty = '9999.0000', s.is_in_stock='1'
WHERE p.type_id = 'simple'
#!/usr/bin/env bash
function get_mage_path {
local result=${PWD##*/}
local ret='./'
if [ "$result" = "var" ]; then
local ret='../';
fi
if [ "$result" = "log" ]; then
local ret='../../';
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
export PS1="\$([[ \$? != 0 ]] && echo \"[\[\033[0;31m\]\342\234\227\[\033[0;37m\]] \")[\e[38;5;240m\@\e[m] [$(if [[ ${EUID} == 0 ]]; then echo '\[\033[0;31m\]\h'; else echo '\[\e[38;5;193m\u\[\033[0;37m\]@\e[38;5;26m\h'; fi)\[\033[0;37m\]][\[\033[0;32m\]\w\[\033[0;37m\]]\e[38;5;198m\$(__git_ps1 "[%s]")\e[m\n$ "
<?php
$postcode = $argv[1];
$regionMap = [
'EC' => [
['4731', '5199'],
['5200', '5299'],
['5300', '5499'],
['5500', '5999'],
@rootindex
rootindex / --Library--LaunchDaemons--co.echo.httpdfwd.plist
Created September 2, 2020 10:47
Making macos on boot redirect port 80 to 8080 and 443 to 8443 on all interfaces permanently, -- = /
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>co.echo.httpdfwd</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>