Skip to content

Instantly share code, notes, and snippets.

View mkdizajn's full-sized avatar
🐢
slow & thorough > faster & mistakable

Kresimir Pendic mkdizajn

🐢
slow & thorough > faster & mistakable
View GitHub Profile
@mkdizajn
mkdizajn / magento transactional email insert cms static blocks
Last active November 18, 2021 15:02
magento transactional email insert cms static blocks
magento transaction email insert block
cms/content.phtml == just returt cms block content!
{{block type="cms/block" block_id="blockIdHere" template="cms/content.phtml"}}
@mkdizajn
mkdizajn / magento webforms inside page, product or anything else
Last active December 23, 2015 21:59
magento webforms inside page, product or anything else!
<reference name="content">
<block type="webforms/webforms" name="rfq" template="webforms/default.phtml">
<action method="setData">
<key>webform_id</key>
<value>1</value>
</action>
</block>
</reference>
@mkdizajn
mkdizajn / bootsrap_class_list
Created November 6, 2013 15:28 — forked from geksilla/bootsrap_class_list
bootsrap_class_list
.navbar
.caret
.label
.table
.img-responsive
.img-rounded
.img-thumbnail
.img-circle
.sr-only
.lead
@mkdizajn
mkdizajn / function.php
Last active May 6, 2020 15:59
Wordpress Bootstrap 3 responsive images
<?php
//----------------------------------------------------------/
// responsive images [ 1) add img-responsive class 2) remove dimensions ]
//----------------------------------------------------------/
function bootstrap_responsive_images( $html ){
$classes = 'img-responsive'; // separated by spaces, e.g. 'img image-link'
// check if there are already classes assigned to the anchor
if ( preg_match('/<img.*? class="/', $html) ) {
@mkdizajn
mkdizajn / 000-default
Last active December 28, 2015 07:59
wordpress one config setup
<VirtualHost *:80>
ServerName www.some-host.io
SetEnv ENV "mk"
DocumentRoot /home/path/html
</VirtualHost>
@mkdizajn
mkdizajn / gist:8630775
Created January 26, 2014 10:00
magento switch websites snippet
<!-- BEGIN website switcher -->
<select id="website-changer" onChange="document.location=this.options[selectedIndex].value">
<?php
$websites = Mage::getModel('core/website')->getCollection();
foreach($websites as $website)
{
$default_store = $website->getDefaultStore();
$url_obj = new Mage_Core_Model_Url();
$default_store_path = $url_obj->getBaseUrl(array('_store'=> $default_store->getCode()));
?>
@mkdizajn
mkdizajn / gist:8640901
Created January 26, 2014 23:31
wordpress subdirectory install
Using a pre-existing subdirectory install
If you already have WordPress installed in its own folder (e.g., http://example.com/wordpress), then the steps are as follows:
Go to the General panel.
In the box for Site address (URL): change the address to the root directory's URL. Example: http://example.com
Click Save Changes. (Do not worry about the error message and do not try to see your blog at this point! You will probably get a message about file not found.)
Copy (NOT MOVE!) the index.php and .htaccess files from the WordPress (wordpress in our example) directory into the root directory of your site—the latter is probably named something like www or public_html. The .htaccess file is invisible, so you may have to set your FTP client to show hidden files. If you are not using pretty permalinks, then you may not have a .htaccess file. If you are running WordPress on a Windows (IIS) server and are using pretty permalinks, you'll have a web.config rather than a .htaccess file in your WordPress directory.
Edit
@mkdizajn
mkdizajn / gist:8813861
Created February 4, 2014 22:40
jquery inspector pubnub add script to page dinamicly
(function(d,s){s=d.createElement('script');s.src='//cdn.pubnub.com/pubnub.min.js';(d.head||d.documentElement).appendChild(s)})(document);
@mkdizajn
mkdizajn / Preferences.sublime-settings
Created February 9, 2014 22:58
sublime my user preferences
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"detect_slow_plugins": false,
"font_face": "Inconsolata",
"font_size": 12,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Nettuts+ Fetch",
@mkdizajn
mkdizajn / laravel routes.php
Last active September 22, 2015 09:27
laravel group secure pages routes
<?// guarded pages!
Route::group(array('before' => 'auth'), function()
{
Route::get('/', ['as' => 'home', function() { return View::make('home'); }]);
Route::get('/table_info', function() { return View::make('news/table_info'); });
Route::get('/logout', 'SessionsController@logoff');
Route::resource('news', 'NewsController'); // get, post, delete, patch,
});
// open loged out pages!