Skip to content

Instantly share code, notes, and snippets.

View pedro2555's full-sized avatar
😷
Out sick

Pedro Rodrigues pedro2555

😷
Out sick
View GitHub Profile
@pedro2555
pedro2555 / designer.html
Last active August 29, 2015 14:13
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
<link rel="import" href="../core-pages/core-pages.html">
<polymer-element name="my-element">
<template>
<style>
@pedro2555
pedro2555 / alias.txt
Last active October 12, 2017 15:09
Euroscope alias file for Portugal
.onpt .msg $aircraft Olá, boa tarde. Só uma pequena informação, próxima terça feira, dia 4 entre as 1900z e as 2100z, vai haver o Lisboa Online Day, caso tenhas vontade de voar de/para Lisboa com full ATC.
.onen .msg $aircraft Hi, good afternoon. Just a quick info, next Tuesday, 4th of July between 1900z and 2100z Lisboa will be fully staffed for our Lisboa Online Day, in case you're interested in flying to/from a fully staffed Lisboa.
.on /Good evening, $radioname is online.
.off /$radioname is closing. Good night for all.
.good Good evening sir.
.good2 Good evening sir, radar contact.
.good3 Good evening sir, radar contact. Continue as filed.
.radar Radar contact.
.filed Continue as filed.
using System;
using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
@pedro2555
pedro2555 / aerosoft-airbus-xpnder-fix.lua
Last active July 30, 2017 14:11
Makes the transponder setting on the Aerosoft Airbus A320 family aircraft visible to vPilot
function xpndr(varname,value)
if value==5 then
ipc.writeSB(0x7B91, 0)
elseif value==4 then
ipc.writeSB(0x7B91, 0)
elseif value==3 then
ipc.writeSB(0x7B91, 0)
elseif value==2 then
ipc.writeSB(0x7B91, 1)
elseif value==1 then
@pedro2555
pedro2555 / K2 "The Name property cannot be set to empty."
Last active August 2, 2017 10:39
K2 "The Name property cannot be set to empty."
This is a compilation of solutions to the K2 Blackpearl error:
'The name property cannot be set to empty'
^AP;([\w]{4});.*?;(.*?);(.*?);(.*?)$
insert into airports \(ICAO, LAT, LONG, ALT\) values \('$1', $2, $3, $4\)
@pedro2555
pedro2555 / gist:0d5f61c5d2969420d13763bf10dc7623
Last active February 20, 2018 18:56
Python dev cheatsheet
`virtualenv --python=/usr/bin/python3 .` create virtualenv on the project folder, if not done already
`source bin/activate` initiate the virtualenv
`pip install -r requirements.txt` or `pip install -r dev-requirements.txt` install python modules
`sudo /etc/init.d/mongo start` start the mongo instance (only required on Linux Subsystem for Windows)
`source deactivate` exit the virtualenv
from selenium import webdriver
from collections import deque
browser = webdriver.Chrome()
try:
browser.get('http://www.portugal-vacc.org/')
# just chrome devtools'd this
# TODO: make sure this doesn't break when theres no scheduled ATC
elem = browser.find_element_by_css_selector('\
@pedro2555
pedro2555 / EncryptString.cs
Last active November 28, 2022 14:31
Jon Galloway - Encrypting Passwords in a .NET app.config File
///
/// https://weblogs.asp.net/jongalloway/encrypting-passwords-in-a-net-app-config-file
///
static byte[] entropy = System.Text.Encoding.Unicode.GetBytes("Salt Is Not A Password");
public static string EncryptString(System.Security.SecureString input)
{
byte[] encryptedData = System.Security.Cryptography.ProtectedData.Protect(
System.Text.Encoding.Unicode.GetBytes(ToInsecureString(input)),
TAP FLIGHTPLAN - IFR TAP201B CS-TON LPPT-KEWR
--------------------------------------------------------------------------------
ALL WEIGHTS IN KILOGRAMS (KG) STD 11AUG/2225Z
--------------------------------------------------------------------------------
OFP 1 - PREPARED 11AUG/2155Z BY PEDRO RODRIGUES
TP201/TAP201B CS-TON/B77LGE ROUTE: DEFRTE
DEP: LPPT/LIS 03 ELEV 374 FT COST INDEX: 13 TTL G/C DIST: 2937 NM
ARR: KEWR/EWR 04L ELEV 17 FT INIT ALT: FL380 TTL F/P DIST: 3107 NM