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
import scrapy | |
class DienmayxanhSpider(scrapy.Spider): | |
name = "dienmayxanh" | |
def start_requests(self): | |
urls = [ | |
"https://www.dienmayxanh.com", | |
] |
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==4.0.5 | |
djangorestframework==3.13.1 | |
Pillow==9.1.1 |
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
class SaleOrder(models.Model): | |
_inherit = "sale.order" | |
@api.model_create_multi | |
def create_from_po(self, vals_list): | |
partner = self.env['res.partner'].search([('name', 'ilike', self.env.user.name)], limit=1) | |
if not partner: | |
raise ValidationError(_('Partner database is not configured properly')) | |
product_codes = set() | |
uom_names = set() |
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
#!/bin/sh | |
yarn install | |
yarn build | |
git checkout --orphan latest | |
mkdir release_tmp | |
mv packages/ui/dist release_tmp/dist | |
mv packages/ui/package.json release_tmp | |
rm -rf packages | |
rm `find . -type f | grep -Ev '.git|release_tmp|node_modules'` |
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 | |
namespace App\Models; | |
use App\Notifiable; | |
use Illuminate\Auth\Authenticatable; | |
use Illuminate\Auth\Passwords\CanResetPassword; | |
use Laravel\Lumen\Auth\Authorizable; | |
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; | |
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract; |
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
quants = env['stock.quant'].search([]) | |
move_line_ids = [] | |
warning = '' | |
for quant in quants: | |
move_lines = env["stock.move.line"].search([ | |
('product_id', '=', quant.product_id.id), | |
('location_id', '=', quant.location_id.id), | |
('lot_id', '=', quant.lot_id.id), | |
('package_id', '=', quant.package_id.id), | |
('owner_id', '=', quant.owner_id.id), |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrfaYSxlYBMtYUrxxobQPMvPu+FPrQjfacG2XLp7gH5MGnt6ChSyBzAVs9x0goanp6HBX/yq7m4yOjAJr+/Us/rRwjTB5f39jyt0rxqmdmLZKgJf6FhOjfxcJYlJMdUmhFUQyKq3Z0jDAZeu7Fd1LXp8Ky8ow1Ra1eT9FAHZzSfzW9EBKibmKc8+dQpw4mnHc2GpCO7Fqd3m120zDSJJHtn+xrQGB5akLeMO3HBkAPeKUq+ntPA6qz5nRT8Nx9kIo3sDMMWT7Cu3l/rrjondufpP72WAeeZ4GN42K3XQJAqnp/AjXrtN/cCnMT8N9YjgXLVLyVZc4vKbCNfXCd/vRn [email protected] |
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
CREATE TABLE [dbo].[AspNetRoleClaims] ( | |
[Id] INT IDENTITY (1, 1) NOT NULL, | |
[RoleId] NVARCHAR (450) NOT NULL, | |
[ClaimType] NVARCHAR (MAX) NULL, | |
[ClaimValue] NVARCHAR (MAX) NULL, | |
CONSTRAINT [PK_AspNetRoleClaims] PRIMARY KEY CLUSTERED ([Id] ASC), | |
CONSTRAINT [FK_AspNetRoleClaims_AspNetRoles_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[AspNetRoles] ([Id]) ON DELETE CASCADE | |
); | |
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
result = db.session.execute( | |
db | |
.update(Contact, values={'value': payload['value']}, returning=Contact.__table__.columns) | |
.where(Contact.id == payload['id']) | |
) | |
db.session.commit() | |
fetched_data = result.first() | |
contact = {} | |
for (index, column) in enumerate(result.keys()): | |
contact[column] = fetched_data[index] |
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
import React from 'react' | |
import Validator from 'validatorjs' | |
import styled from 'styled-components' | |
import en from 'validatorjs/src/lang/en' | |
import { TextField } from 'office-ui-fabric-react/lib/TextField' | |
import { DefaultButton } from 'office-ui-fabric-react/lib/Button' | |
Validator.setMessages('en', en) | |
const Spacer = styled.div` |
NewerOlder