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
#include <math.h> | |
constexpr double R = 6378.137; | |
constexpr double ESQ (6.69437999014 * 0.001); | |
constexpr double DEG2RAD = M_PI / 180.0; | |
template<typename T> | |
struct point { | |
using coordinate_type = T; | |
T x; |
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
function screenToNdc(x, y) { | |
return [(x / window.innerWidth) * 2 - 1, (y / window.innerHeight) * 2 + 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
#include "requestmanager.h" | |
/// | |
/// RequestManager constructor | |
/// | |
/// Description: sets up a network access manager that | |
/// abstract the HTTP/TCP protocol | |
RequestManager::RequestManager(QObject *parent) : QObject(parent) | |
{ |
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
#include "stdlib.h" | |
/* | |
* string_length: | |
* Returns the length of the pointer *s | |
* Same as strlen in <stdlib> | |
*/ | |
unsigned long string_length(const char *s) { | |
int c = 0; | |
// dereference the pointer until EOF and raise the counter 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
# -*- coding: utf-8 -*- | |
""" | |
@author: Ólafur Aron Jóhannsson | |
@email: [email protected] | |
""" | |
import optparse, nmap, re | |
from socket import * | |
from threading import * |
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
package EmailSender | |
import ( | |
"net/smtp" | |
"strconv" | |
) | |
type EmailSender interface { | |
Send() error |
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
/// <summary> | |
/// Reqeust manager encapsulates asynchronous HTTP GET and POST methods | |
/// In conjunction with that, it internally caches requests made in the same minute | |
/// </summary> | |
public class RequestManager | |
{ | |
private Dictionary<string, string> CustomHeaders = null; | |
public RequestManager(Dictionary<string, string> customHeaders = null) | |
{ |
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
def send_email(to, _from, subject, message): | |
msg = "\r\n".join([ | |
"From: " + _from, | |
"To: " + to, | |
"Subject: " + subject, | |
"", | |
message | |
]) | |
server = smtplib.SMTP(SMTP_SERVER) | |
server.ehlo() |