Skip to content

Instantly share code, notes, and snippets.

View inoyatov's full-sized avatar
🤖
Working in automatic mood

Inoyatov Khamidulla inoyatov

🤖
Working in automatic mood
View GitHub Profile
@inoyatov
inoyatov / vimrc
Created August 9, 2020 09:30
Test
#!/bin/sh
if [ "${TERM%%-*}" = "screen" ]; then
if [ -n "$TMUX" ]; then
printf "\033Ptmux;\033\033]4;236;rgb:32/30/2f\007\033\\"
printf "\033Ptmux;\033\033]4;234;rgb:1d/20/21\007\033\\"
printf "\033Ptmux;\033\033]4;235;rgb:28/28/28\007\033\\"
printf "\033Ptmux;\033\033]4;237;rgb:3c/38/36\007\033\\"
printf "\033Ptmux;\033\033]4;239;rgb:50/49/45\007\033\\"
@inoyatov
inoyatov / permissions.py
Created April 3, 2019 01:51
Group based permissions for Django Rest Framework
from django.contrib.auth.models import User, Group
from rest_framework import permissions
def is_in_group(user, group_name):
try:
return Group.objects.get(name=group_name).user_set.filter(id=user.id).exists()
except Group.DoesNotExist:
return False
class HasGroupPermission(permissions.BasePermission):
@inoyatov
inoyatov / buffb
Created July 22, 2018 18:17
buffer
GRUB_CMDLINE_LINUX="cryptopts=target=CryptDisk,source=/dev/disk/by-uuid/e0d8a06d-5f34-405c-b9b6-250461c201be,keyscript=/lib/cryptsetup/scripts/passdev,key=/dev/disk/by-label/backup:/.syscard,lvm=lvm-vg"
@inoyatov
inoyatov / index.html
Created July 21, 2018 05:10
Client Video View page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Client View</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
// This file was generated by libdot/bin/concat.sh.
// It has been marked read-only for your safety. Rather
// than edit it directly, please modify one of these source
// files...
//
// libdot/js/lib.js
// libdot/js/lib_polyfill.js
// libdot/js/lib_array.js
// libdot/js/lib_colors.js
// libdot/js/lib_f.js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
XLM/BTC
XRP/BTC
ETH/BTC
XVG/BTC
ADA/BTC
STEEM/BTC
BCC/BTC
NEO/BTC
LTC/BTC
POWR/BTC
#!/bin/python3
# https://www.hackerrank.com/contests/w34/challenges/same-occurrence
import sys
from collections import Counter
def query(x, y, arr):
l = len(arr)
counter = 0
for i in range(l, 0, -1):
@inoyatov
inoyatov / cheatsheets.txt
Created July 19, 2017 01:26
Python CheatSheets
https://www.cheatography.com/davechild/cheat-sheets/python/pdf/
https://s3.amazonaws.com/assets.datacamp.com/blog_assets/Numpy_Python_Cheat_Sheet.pdf
https://ddi.ifi.lmu.de/probestudium/2013/ws-i-3d-programmierung/tutorials/python-referenzkarte
https://perso.limsi.fr/pointal/_media/python:cours:mementopython3-english.pdf
@inoyatov
inoyatov / .xmodmap-custom
Created January 16, 2017 07:54
Configuration files of Xmodmap
keycode 8 =
keycode 9 = Escape NoSymbol Escape
keycode 10 = 1 exclam 1 exclam
keycode 11 = 2 at 2 at
keycode 12 = 3 numbersign 3 numbersign
keycode 13 = 4 dollar 4 dollar
keycode 14 = 5 percent 5 percent
keycode 15 = 6 asciicircum 6 asciicircum
keycode 16 = 7 ampersand 7 ampersand
keycode 17 = 8 asterisk 8 asterisk