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
; NASM i386 | |
; nasm -f elf print_odd_even.asm | |
; ld -m elf_i386 print_odd_even.o -o print_odd_even | |
; | |
; EXAMPLE | |
; bash# ./print_odd_even | |
; Enter the string: The quick brown fox jumps over the lazy dog | |
; Odd: | |
; Teqikbonfxjmsoe h aydg | |
; Even: |
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
# TCVN3 to UTF-8 | |
UNICODETAB = [ | |
"À", "Á", "Â", "Ã", "È", "É", "Ê", "Ì", "Í", "Ò", | |
"Ó", "Ô", "Õ", "Ù", "Ú", "Ý", "à", "á", "â", "ã", | |
"è", "é", "ê", "ì", "í", "ò", "ó", "ô", "õ", "ù", | |
"ú", "ý", "Ă", "ă", "Đ", "đ", "Ĩ", "ĩ", "Ũ", "ũ", | |
"Ơ", "ơ", "Ư", "ư", "Ạ", "ạ", "Ả", "ả", "Ấ", "ấ", | |
"Ầ", "ầ", "Ẩ", "ẩ", "Ẫ", "ẫ", "Ậ", "ậ", "Ắ", "ắ", | |
"Ằ", "ằ", "Ẳ", "ẳ", "Ẵ", "ẵ", "Ặ", "ặ", "Ẹ", "ẹ", | |
"Ẻ", "ẻ", "Ẽ", "ẽ", "Ế", "ế", "Ề", "ề", "Ể", "ể", |
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://github.com/psf/requests/issues/2359#issuecomment-552736992 | |
import requests | |
import cchardet | |
class ForceCchardet: | |
@property | |
def apparent_encoding(obj): | |
return cchardet.detect(obj.content)['encoding'] | |
requests.Response.apparent_encoding = ForceCchardet.apparent_encoding |
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/bash | |
# AMD + FFMPEG VAAPI screen+alsa+pulseaudio recording script | |
# In your home directory create .asoundrc with following contents: | |
# pcm.!default pulse | |
# ctl.!default pulse | |
# This allows alsa to use pulseaudio as the input device. | |
# Bind any hotkey to the script. | |
# Launch once - recording starts. Launch twice - recording stops. |
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
for WID in $(xwininfo -root -tree | sed '/"Plasma": ("plasmashell" "plasmashell")/!d; s/^ *\([^ ]*\) .*/\1/g'); do | |
xprop -id $WID -remove _KDE_NET_WM_SHADOW | |
done |
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
export default class PhoneField { | |
constructor( | |
handler, | |
code = '+7', | |
mask = '(___)___-__-__', | |
placeholder = '_' | |
) { | |
this.handler = handler; | |
this.mask = code + mask; | |
this.code = code; |
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
<template> | |
<div> | |
<v-text-field | |
:ref="`input-mask-${identifier}`" | |
v-model="inputPhone" | |
outlined | |
dense | |
label="Номер телефона" | |
hide-details | |
@keydown="input" |
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
const mapCyrillic = { | |
KeyQ: 'й', | |
KeyW: 'ц', | |
KeyE: 'у', | |
KeyR: 'к', | |
KeyT: 'е', | |
KeyY: 'н', | |
KeyU: 'г', | |
KeyI: 'ш', | |
KeyO: 'щ', |
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
# JWT токен не работает в SSR приложениях по типу NextJS/Sveltekit которые не могут передать на сторону сервера заголовки. | |
# Варианта два, передавать токен в кукисах или отказаться от токена. Это второй вариант решения | |
from rest_framework.decorators import api_view, authentication_classes | |
from rest_framework.response import Response | |
from rest_framework import status | |
from drf_yasg.utils import swagger_auto_schema | |
from drf_yasg import openapi | |
from django.contrib.auth import login | |
from ..serializers.Registration import RegistrationSerializer |
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/bash | |
# Will be set to 1 by the SIGINT ignoring/postponing handler | |
declare -ig SIGINT_RECEIVED=0 | |
# On <CTRL>+C or "kill -s SIGINT $$" set flag for later examination | |
function _set_SIGINT_RECEIVED { | |
SIGINT_RECEIVED=1 | |
} | |
# Set to 1 if you want to keep bash running after handling SIGINT in a particular way |
OlderNewer