Вся суть харча™ (на самом деле все далеко не так...)
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 ModelOptions: | |
... | |
class ModelMeta(type): | |
def __new__(mcls, name, bases, attrs): | |
cls = super().__new__(mcls, name, bases, attrs) | |
# if name == 'Model': | |
# return cls |
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
'use strict'; | |
import Sequelize from 'sequelize'; | |
import bcrypt from 'bcryptjs'; | |
export default class User extends Sequelize.Model { | |
static init(sequelize) { | |
return super.init({ | |
username: { | |
type: Sequelize.STRING, | |
unique: true, | |
allowNull: 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
/* | |
* Migration | |
*/ | |
'use strict'; | |
module.exports = { | |
up: function(queryInterface, Sequelize) { | |
return queryInterface.createTable('Users', { | |
firstName: { | |
type: Sequelize.STRING | |
}, |
> [[1,2,3],[4,5,6]].flat()
(6) [1, 2, 3, 4, 5, 6]
Applications - это Programs с графическим интерфейсом.
Folder - это значок для Directory.
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
from collections import OrderedDict | |
import graphene | |
from graphene import relay | |
from graphene.types.utils import yank_fields_from_attrs | |
from graphene_sqlalchemy import SQLAlchemyConnectionField, SQLAlchemyObjectType | |
from graphene_sqlalchemy.converter import (convert_sqlalchemy_column, | |
convert_sqlalchemy_composite, | |
convert_sqlalchemy_hybrid_method) | |
from graphene_sqlalchemy.fields import default_connection_field_factory |
function query(strings, ...values) {
return strings.slice(1).reduce((acc, v, i) => acc + JSON.stringify(values[i]) + v, strings[0])
}
undefined
var username = 'j.doe'
undefined
var password = 'asd123'
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
// https://chromedevtools.github.io/devtools-protocol/1-3/Network | |
chrome.browserAction.onClicked.addListener(async tab => { | |
const target = { tabId: tab.id } | |
// Ждем пока подключимся к debugger | |
await new Promise((resolve, reject) => { | |
chrome.debugger.attach(target, '1.3', result => { | |
if (chrome.runtime.lastError) { | |
reject(chrome.runtime.lastError) | |
} else { | |
resolve(result) |
It was not exactly obvious. Here's how to revert a Gist commit!
Checkout the gist like a normal git repo:
# replace the Gist ID with your own
git clone [email protected]:cc13e0fcf2c348cc126f918e4a3917eb.git
Treat it like a normal repo. Edit, force push, etc.