Skip to content

Instantly share code, notes, and snippets.

View s3rgeym's full-sized avatar
🏴‍☠️
Анархия - основа Интернета

[object Object] s3rgeym

🏴‍☠️
Анархия - основа Интернета
View GitHub Profile
@s3rgeym
s3rgeym / Arch-Install-SED-Luks-Btrfs.md
Last active April 3, 2025 18:03
Установка Arch Linux с шифрованием всего диска либо раздела и Btrfs

image

Вся суть харча™ (на самом деле все далеко не так...)

Установка Arch Linux с шифрованием всего диска либо раздела и Btrfs

@s3rgeym
s3rgeym / orm.py
Last active April 26, 2019 12:46
Концепт ORM
class ModelOptions:
...
class ModelMeta(type):
def __new__(mcls, name, bases, attrs):
cls = super().__new__(mcls, name, bases, attrs)
# if name == 'Model':
# return cls
'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
@s3rgeym
s3rgeym / model-user.js
Created May 6, 2019 19:58 — forked from lucasscariot/model-user.js
Composite Primary Key in Sequelize
/*
* 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.

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'
@s3rgeym
s3rgeym / background.js
Created June 17, 2019 01:09
Chrome Extension: Intercept Requests
// 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)
@s3rgeym
s3rgeym / Revert-Gist.md
Created July 7, 2019 22:34 — forked from eduncan911/Revert-Gist.md
Revert Gist Commits

Revert / Undo a Gist Commit

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.