Skip to content

Instantly share code, notes, and snippets.

View enyasar's full-sized avatar
🏠
Working from home

Erhan YASAR enyasar

🏠
Working from home
View GitHub Profile
@enyasar
enyasar / ListUsersWhoHaveAccess.ps1
Created February 22, 2022 17:53 — forked from normansolutions/ListUsersWhoHaveAccess.ps1
PowerShell script to display all users to have access to other mailboxes in Exchange. Thanks to: http://exchangeserverpro.com/list-users-access-exchange-mailboxes/
Get-Mailbox | Get-MailboxPermission | where {$_.user.tostring() -ne "NT AUTHORITY\SELF" -and $_.IsInherited -eq $false} | Select Identity,User,@{Name='Access Rights';Expression={[string]::join(', ', $_.AccessRights)}} | Export-Csv -NoTypeInformation mailboxpermissions.csv
@enyasar
enyasar / web.sh
Created October 14, 2015 13:06
nginx,php-fpm,mysql,postgresql,java,elasticsearch in macos el capitan
#!/bin/bash
brew tap josegonzalez/php
brew tap homebrew/dupes
brew install php54 --with-fpm --with-imap --without-apache --with-debug --with-postgresql
mkdir -p ~/Library/LaunchAgents
cp /usr/local/opt/php54/homebrew.mxcl.php54.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php54.plist
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
ln -sfv /usr/local/opt/php54/*.plist ~/Library/LaunchAgents
@enyasar
enyasar / gist:9352bdea427657026813
Created July 15, 2015 18:15
Magento Adding existing attribute to all attribute sets
$attSet = Mage::getModel('eav/entity_type')->getCollection()->addFieldToFilter('entity_type_code','catalog_product')->getFirstItem(); // This is because the you adding the attribute to catalog_products entity ( there is different entities in magento ex : catalog_category, order,invoice... etc )
$attSetCollection = Mage::getModel('eav/entity_type')->load($attSet->getId())->getAttributeSetCollection(); // this is the attribute sets associated with this entity
$attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')
->setCodeFilter('firstname')
->getFirstItem();
$attCode = $attributeInfo->getAttributeCode();
$attId = $attributeInfo->getId();
foreach ($attSetCollection as $a)
{
$set = Mage::getModel('eav/entity_attribute_set')->load($a->getId());
css/
|-- option/ # Ayarlar, Değişkenler ve Fonksiyonlar
| |-- _theme.scss - projenin renk kodları ve genel tema ayarları
| |-- _values.scss - offset, size, genel font ayarları, vs...
| |-- _function.scss
| |-- _mixin.scss
|
|-- helper/ # Yardımcı dosyalar
| |-- _normalize.scss - https://github.com/necolas/normalize.css
| |-- _formalize.scss - https://github.com/interacthings/formalize.css/

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `catalog_category_entity`;
TRUNCATE TABLE `catalog_category_entity_datetime`;
TRUNCATE TABLE `catalog_category_entity_decimal`;
TRUNCATE TABLE `catalog_category_entity_int`;
TRUNCATE TABLE `catalog_category_entity_text`;
TRUNCATE TABLE `catalog_category_entity_varchar`;
TRUNCATE TABLE `catalog_category_product`;
TRUNCATE TABLE `catalog_category_product_index`;