This file contains 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
class Matrix: | |
def __init__(self, matrix_string): | |
self.matrix = matrix_string.split("\n") | |
def row(self, index): | |
row = self.matrix[index - 1] | |
row_list = row.split() | |
final_list = list(map(int, row_list)) | |
return final_list |
This file contains 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
const express = require('express'); | |
const app = express(); | |
app.use((req, res, next) => { | |
if (req.headers['x-forwarded-proto'] !== 'https' && process.env.NODE_ENV === 'production') { | |
res.redirect(`https://${req.hostname}${req.url}`); | |
} else { | |
next(); | |
} | |
}); |
This file contains 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
<div class="volume-estimator-output"> | |
<p class="text-center">You will love</p> | |
<p id="volume-result" class="readonly-output">0</p> | |
<p class="text-center">Litres</p> | |
</div> |
This file contains 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
@mixin psd-tracking($tracking) { | |
letter-spacing: #{$tracking / 1000}em; | |
} | |
// To use do: `@include psd-tracking(50);` if your Photoshop character panel says 60. |
This file contains 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 | |
// die('dont do this now'); | |
/** | |
* Helper methods | |
*/ | |
function reindexAllIndices() { | |
for ($i = 1; $i <= 9; $i++) { | |
$process = Mage::getModel('index/process')->load($i); | |
$process->reindexAll(); |
This file contains 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
<config> | |
<modules> | |
<Pointbreak_BoardCategory> | |
<version>0.1.0</version> | |
</Pointbreak_BoardCategory> | |
</modules> | |
<global> | |
<resources> | |
<boardcategory_setup> | |
<setup> |
This file contains 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 | |
class Pointbreak_BoardCategory_Model_Resource_Setup extends Mage_Catalog_Model_Resource_Setup { | |
} |
This file contains 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 | |
$setup = new Mage_Eav_Model_Entity_Setup('core_setup'); | |
// Add attributes to the various sets | |
$attributeId = $setup->getAttribute('catalog_product', 'teaser'); | |
$attributeSetId = $setup->getAttributeSetId('catalog_product', 'Default'); | |
//Get attribute group info | |
$attributeGroupId = $setup->getAttributeGroup('catalog_product', $attributeSetId, 'General'); |
This file contains 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
<div class="content pad request_a_demo_page"> | |
<div class="text"> | |
<form action="" class="public-form" id="request-demo" method="post"> | |
<fieldset> | |
<legend>Request a Demo</legend> | |
<p>All fields are required</p> | |
<ol> | |
<li> | |
<label for="name">Name</label> |
This file contains 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
public function request_a_demo() { | |
$data = array(); | |
$data['for_universities_section'] = TRUE; | |
$this->form_validation->set_rules('name', 'Name', 'trim|required'); | |
$this->form_validation->set_rules('institution', 'University/College', 'trim|required'); | |
$this->form_validation->set_rules('position', 'Position', 'trim|required'); | |
$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email'); | |
if ($this->form_validation->run() == FALSE) |
NewerOlder