Skip to content

Instantly share code, notes, and snippets.

View aliomattux's full-sized avatar

Kyle Waid aliomattux

View GitHub Profile
<h1 id="title" class="title">Login</h1>
<p class="sub-title">Hello! Log in with your email.</p>
<form #myForm="ngForm" (ngSubmit)="login()" aria-labelledby="title">
<div class="form-control-group">
<label class="label" for="input-email">Email address:</label>
<input nbInput
fullWidth
import { Component } from '@angular/core';
@Component({
selector: 'login',
styleUrls: [],
templateUrl: './login.component.html',
})
export class LoginComponent {
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { LoginComponent } from './login.component';
import { FormsModule } from '@angular/forms';
export const routes: Routes = [
{
path: '',
component: LoginComponent,
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { NgxAuthRoutingModule } from './auth-routing.module';
import {
NbAlertModule,
NbButtonModule,
NbCheckboxModule,
#Decorator function to create global method (Extend the object service)
#add this function outside of any class!
def extend(class_to_extend):
"""
Decorator to use to extend a existing class with a new method
Example :
@extend(osv.osv)
def new_method(self, *args, **kwargs):
print 'I am in the new_method', self._name
return True
#Your dictionary of crawl values
vals = {
'name':
'date':
'lines': self.prepare_lines(),
}
def prepare_lines():
objects = find_objects()
<field name="crawls" widget="one2many_list" nolabel="1">
<tree string="">
<field name="name" />
<field name="enabled" />
<field name="crawl_type" />
</tree>
<form string="">
<field name="name" />
<field name="enabled" />
<field name="crawl_type" />
@aliomattux
aliomattux / gist:dee79c6ab2bdfb0b396ef0f7d0eccb9d
Created May 17, 2016 19:22
Request POST for Ajax Magento
(
[item] => Array
(
[124289] => Array
(
[qty] => 1
[bundle_option_qty] => Array
(
[33607] => 1
[33608] => 1
public function updateproductstock(array $productData) {
foreach ($productData as $productId => $data) {
$productId = (int) $productId;
$isInStock = $data['is_in_stock'];
$manageStock = $data['manage_stock'];
$qty = $data['qty'];
$configManageStock = $data['config_manage_stock'];
$this->updateOneProductStock($productId, $isInStock, $manageStock, $qty, $configManageStock);
}
// $process = Mage::getModel('index/indexer')->getProcessByCode('cataloginventory_stock');
<?php
/**
*
* @category USWF
* @package GroupedCartName
* @author Kyle Waid
*/
/* @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;