- python:
sublime.KIND_ID_AMBIGUOUS
, .sublime-completions:"ambiguous"
- python:
sublime.KIND_ID_KEYWORD
, .sublime-completions:"keyword"
- python:
sublime.KIND_ID_TYPE
, .sublime-completions:"type"
- python:
sublime.KIND_ID_FUNCTION
, .sublime-completions:"function"
- python:
sublime.KIND_ID_NAMESPACE
, .sublime-completions:"namespace"
- python:
sublime.KIND_ID_NAVIGATION
, .sublime-completions:"navigation"
- python:
sublime.KIND_ID_MARKUP
, .sublime-completions:"markup"
- python:
sublime.KIND_ID_VARIABLE
, .sublime-completions:"variable"
This file contains 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
# /etc/netplan/50-cloud-init.yml | |
network: | |
renderer: NetworkManager | |
ethernets: | |
eth0: | |
dhcp4: true | |
version: 2 |
This file contains 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 importlib | |
import os | |
__pkg_path = os.path.join( | |
os.path.dirname(os.path.dirname(os.path.dirname(__file__))), | |
'Packages', | |
'Package Control', | |
'package_control' | |
) | |
__file_path = os.path.join(__pkg_path, '__init__.py') |
This file contains 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 Default.exec import ExecCommand | |
class MyFirstExecCommand(ExecCommand): | |
def finish(self, proc): | |
super().finish(proc) | |
errs = self.output_view.find_all_results() | |
if len(errs) == 0: | |
sublime.active_window().run_command('my_second_exec_command') | |
class MySecondExecCommand(ExecCommand): |
This file contains 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 asn1crypto.csr import CertificationRequest | |
cr = CertificationRequest.load(der_bytes) | |
attrs = cr['certification_request_info']['attributes'] | |
print(attrs.native) |
This file contains 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
if signed: | |
if value < 0: | |
bits_required = abs(value + 1).bit_length() | |
else: | |
bits_required = value.bit_length() | |
if bits_required % 8 == 0: | |
bits_required += 1 | |
else: | |
bits_required = value.bit_length() | |
width = math.ceil(bits_required / 8) or 1 |
This file contains 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
%YAML 1.2 | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2015 FichteFoll <[email protected]> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to | |
# deal in the Software without restriction, including without limitation the | |
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
# sell copies of the Software, and to permit persons to whom the Software is |
This file contains 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
TrustedCertificate ::= SEQUENCE { | |
trust SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, | |
reject [0] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, | |
alias UTF8String OPTIONAL, | |
keyid OCTET STRING OPTIONAL, | |
other [1] IMPLICIT SEQUENCE OF AlgorithmIdentifier OPTIONAL | |
} |
This file contains 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 | |
$conn = fsockopen('localhost', 8080); | |
$send = function($data) use ($conn) { | |
fwrite($conn, $data); | |
} | |
$send('Hello'); | |
$send('World'); | |
$send('\n'); |
This file contains 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 asn1crypto import x509, pem | |
with open('path/to/my.crt', 'rb') as f: | |
data = f.read() | |
if pem.detect(data): | |
_, _, data = pem.unarmor(data) | |
cert = x509.Certificate.load(data) | |
for rdn in cert.subject.chosen: | |
for type_value in rdn: | |
type_name = type_value['type'].native |
NewerOlder