Skip to content

Instantly share code, notes, and snippets.

View brodkin's full-sized avatar
😃
Living my best life

Ryan Brodkin brodkin

😃
Living my best life
  • Los Angeles, CA
  • 14:27 (UTC -08:00)
View GitHub Profile
#cloud-config
coreos:
etcd:
discovery: https://discovery.etcd.io/stuff
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
- name: fleet-metadata.service
command: start
@brodkin
brodkin / magento-auth-admin-pass
Last active December 19, 2015 03:39
Magento Force Admin Login With Password
Mage::app("default");
$username = 'admin';
$password = 'password';
try{
$authenticated = Mage::getModel('admin/user')->authenticate($username, $password);
} catch ( Exception $e ) {
$authenticated = false;
}
@brodkin
brodkin / magento-auth-customer-nopass
Last active May 3, 2017 15:48
Magento Force Customer Login Without Password
// Retrieve Customer by Email (or other method)
$customer = Mage::getModel('customer/customer')
->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
->loadByEmail($email);
// Set as Logged In and Clear Session
Mage::getSingleton('customer/session')->setCustomerAsLoggedIn($customer)
->renewSession();
// Redirect or do something here :)
@brodkin
brodkin / magento-auth-customer-pass
Last active December 19, 2015 03:39
Magento Force Customer Login With Password
Mage::app("default");
// Set the variables that we care about.
$storeId = 1;
$username = '[email protected]';
$password = 'theirpassword';
try{
$authenticated = Mage::getModel('customer/customer')
->setWebsiteId($storeId)
@brodkin
brodkin / .bash_profile
Created April 6, 2013 18:55
Git-Enhanced Bash Prompt Displays color-coded information about your current project on the command line.
######################################
# Git-Enhanced Bash Prompt #
######################################
txtred='\033[0;31m'
txtgrn='\033[0;32m'
txtylw='\033[1;33m'
txtltcyn='\033[1;36m'
end='\033[0m'
# Color-Coded Name of Branch