This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$write = Mage::getSingleton("core/resource")->getConnection("core_write"); | |
$query = "insert into mage_example (name, email, company, description, status, date) values (:name, :email, :company, :desc, 0, NOW())"; | |
$binds = array( | |
'name' => "name' or 1=1", | |
'email' => "email", | |
'company' => "company", | |
'desc' => "desc", | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// using model magento\app\code\core\Mage\Core\Model\Email\Template.php | |
public function send_error_email($error = NULL) { | |
$mailTemplate = Mage::getModel('core/email_template'); | |
$mailTemplate->setSenderName('Insert Sender Name'); // use general Mage::getStoreConfig('trans_email/ident_general/name'); | |
$mailTemplate->setSenderEmail('[email protected]'); // use general Mage::getStoreConfig('trans_email/ident_general/email') | |
$mailTemplate->setTemplateSubject('Insert Subject Title'); | |
$mailTemplate->setTemplateText('Insert Body Text'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* checking the $resource object when event runs | |
*/ | |
switch ($modx->event->name) { | |
case 'OnBeforeDocFormSave': | |
$modx->log(modX::LOG_LEVEL_INFO, print_r($resource)); | |
break; | |
case 'OnDocFormSave': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python2.7 | |
import urllib2, json | |
def get_coorinates(request): | |
eat_all = Eat.objects.all().values() | |
for eat in eat_all: | |
obj = Eat.objects.filter(id=eat['id'])[0] | |
address = obj.address.replace(" ", "+") | |
url = "".join(["http://maps.googleapis.com/maps/api/geocode/json?address=", address, "&sensor=false"]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> oclHashcat64.exe -m 500 example.hash example.dict |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Conway's "Life" | |
* | |
* Adapted from the Life example | |
* on the Processing.org site | |
* | |
* Needs FrequencyTimer2 library | |
*/ | |
#include <FrequencyTimer2.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo dir %1 > %systemroot%\system32\ls.bat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# django | |
Vagrant.configure("2") do |config| | |
config.vm.define :djangovm do |django_config| | |
django_config.vm.box = "lucid32" | |
django_config.vm.network :forwarded_port, guest: 8000, host: 8001 | |
django_config.vm.synced_folder "../app/shared", "/home/vagrant/django" | |
django_config.vm.provision :chef_solo do |chef| | |
chef.cookbooks_path = "../app/cookbooks" | |
chef.add_recipe "apt" | |
chef.add_recipe "git" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# network | |
Go to VirtualBox โ Preferences โ select Network tab and create a Host-Only Network adapter (Adapter 1) | |
Go to VirtualBox โ Preferences โ select Network tab and create a NAT Network adapter (Adapter 2) | |
Boot up the VM | |
Open Terminal | |
ifconfig // should see eth0 and eth1 | |
# allow the host to see web server | |
sudo system-config-firewall |