Skip to content

Instantly share code, notes, and snippets.

Ryan Brodkin brodkin

Block or report user

Report or block brodkin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cloud-config.yml
#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 Dec 19, 2015
Magento Force Admin Login With Password
View magento-auth-admin-pass
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
Magento Force Customer Login Without Password
View magento-auth-customer-nopass
// 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 Dec 19, 2015
Magento Force Customer Login With Password
View magento-auth-customer-pass
Mage::app("default");
// Set the variables that we care about.
$storeId = 1;
$username = 'their.email@their.domain.com';
$password = 'theirpassword';
try{
$authenticated = Mage::getModel('customer/customer')
->setWebsiteId($storeId)
@brodkin
brodkin / .bash_profile
Created Apr 6, 2013
Git-Enhanced Bash Prompt Displays color-coded information about your current project on the command line.
View .bash_profile
######################################
# 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
You can’t perform that action at this time.