Skip to content

Instantly share code, notes, and snippets.

View markshust's full-sized avatar
🤓
Working on educational & training material for Magento 2

Mark Shust markshust

🤓
Working on educational & training material for Magento 2
View GitHub Profile
@markshust
markshust / gist:2782048
Created May 24, 2012 14:56
Quickly check if Magento core files are modified
diff -qrbB magento_folder client_folder
@markshust
markshust / gist:2845930
Created May 31, 2012 20:17
Find (expires) header information for an image or anything else
lynx -dump -head http://url-to-resource.com/path.jpg
@markshust
markshust / urlhref.php
Created June 21, 2012 17:35
Convert a .com or another address to a full-on clickable link
<?php
/**
* $url can equal any of the following URL formats:
*
* http://www.domain.com
* https://www.domain.net
* http://subdomain.domain.org
* www.domain.com/folder
* subdomain.domain.net
* subdomain.domain.edu/folder/subfolder
@markshust
markshust / gist:3065928
Created July 7, 2012 11:11
install django with postgres support on mac lion running zend server
sudo easy_install pip
sudo pip install django
sudo pip install django-extensions
# postgres support
sudo pip install psycopg2
# on mountain lion, edit postgres conf file for custom socket
sudo vi /usr/local/var/postgres/postgresql.conf
# update unix_socket_directory
@markshust
markshust / gist:3204646
Created July 30, 2012 04:35
install apache mod_wsgi on mountain lion
# create symlink to solve missing directory on mountain lion
sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain
# install mod with brew
brew install mod_wsgi
# add this line to httpd.conf and restart apache
LoadModule wsgi_module /usr/local/Cellar/mod_wsgi/3.3/libexec/mod_wsgi.so
sudo apachectl restart
@markshust
markshust / gist:3204878
Created July 30, 2012 05:03
install postgres on mountain lion
brew install postgres --without-ossp-uuid
initdb /usr/local/var/postgres
@markshust
markshust / gist:3753945
Created September 20, 2012 04:12
obj_get_list example with filtering
def obj_get_list(self, request=None, **kwargs):
if 'area' in request.GET and request.GET['area'] and 'item' in request.GET and request.GET['item']:
area_val = request.GET['area']
item_val = request.GET['item']
queryset = ItemToArea.objects.filter(area=area_val,item=item_val)
return queryset
if 'area' in request.GET and request.GET['area']:
area_val = request.GET['area']
queryset = ItemToArea.objects.filter(area=area_val)
return queryset
@markshust
markshust / manualcron.php
Last active December 13, 2017 04:44
Magento - run cronjobs manually from CLI
<?php
/*
Given:
<foo_bar_baz>
<schedule>
<cron_expr>0 0 * * *</cron_expr>
</schedule>
<run>
<model>foo/bar::baz</model>
</run>
@markshust
markshust / gist:4533336
Created January 14, 2013 20:54
Generate 256-bit Private Key & CSR on RedHat Linux
sudo openssl req -new -newkey rsa:2048 -nodes -keyout /etc/pki/tls/private/domain.com.key -out /etc/pki/tls/private/domain.com.csr
@markshust
markshust / gist:4746451
Created February 9, 2013 18:28
gitsync
alias gitsync="git fetch upstream && git merge upstream/develop && git push origin develop"