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
# Your keymap | |
# | |
# Pulsar keymaps work similarly to style sheets. Just as style sheets use | |
# selectors to apply styles to elements, Pulsar keymaps use selectors to associate | |
# keystrokes with events in specific contexts. Unlike style sheets however, | |
# each selector can only be declared once. | |
# | |
# You can create a new keybinding in this file by typing "key" and then hitting | |
# tab. | |
# |
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 Document | |
def initialize(document) | |
@document = document | |
end | |
def raw | |
@document | |
end | |
def is_cnpj? |
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
import asyncio | |
from time import time | |
import httpx | |
url = 'https://api.coindesk.com/v1/bpi/currentprice.json' | |
async def busca_bitcoin(): | |
async with httpx.AsyncClient() as client: | |
print((await client.get(url)).text) |
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
#!/usr/bin/env python3 | |
from urllib.request import urlopen | |
import boto3 | |
class SecurityGroup: | |
def __init__(self, security_group_id: str): | |
ec2 = boto3.resource('ec2') | |
self.security_group_id = security_group_id |
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
# Connect | |
openvpn3 session-start --config ~/test.ovpn | |
# List connections | |
openvpn3 sessions-list | |
# Disconnect | |
openvpn3 session-manage --session-path /net/openvpn/v3/sessions/fbd8d1d7s682cs5555sb18bs4c10c18c28ea --disconnect | |
# Enable Split tunneling, add this lines to .ovpn file | |
route-nopull | |
route 192.168.8.1 255.255.255.255 |
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
# Redirect Ports using IPTables | |
sudo iptables -t nat -A PREROUTING -i ens18 -p tcp --dport 80 -j REDIRECT --to-port 8080 | |
# IP forwarding: Receive packets on one PORT and forward to another IP and PORT. | |
# Can redirect packages through a VPN client connection. Ex: EC2 linux receive packages and route through VPN. | |
sudo sysctl net.ipv4.ip_forward=1 | |
sudo iptables -A INPUT -p tcp --dport 1444 -j ACCEPT | |
sudo iptables -t nat -A PREROUTING -p tcp --dport 1444 -j DNAT --to-destination 192.168.8.6:1433 | |
sudo iptables -t nat -A POSTROUTING -p tcp -d 192.168.8.6 --dport 1433 -j MASQUERADE |
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
;; Melpa | |
(require 'package) | |
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos)) | |
(not (gnutls-available-p)))) | |
(proto (if no-ssl "http" "https"))) | |
(when no-ssl | |
(warn "\ | |
Your version of Emacs does not support SSL connections, | |
which is unsafe because it allows man-in-the-middle attacks. | |
There are two things you can do about this warning: |
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
domain | |
([\w-]+\.)+(\w+) | |
link to another page | |
href="(.+?)" | |
link to another page excluding extensions | |
href="(.+(?:(?<!css|js|jpg|jpeg|gif|tiff|png|bmp|svg|ico)))" |
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
import std.stdio; | |
import core.memory; | |
import std.algorithm.mutation; | |
void main() | |
{ | |
int[] list; | |
int[] list2; | |
int[] result; |
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 TextComponent { | |
static template () { | |
return `<button type="button"> | |
StaticText | |
</button>` | |
} | |
app.components = { | |
'text-component': TextComponent, | |
}; |
NewerOlder