Skip to content

Instantly share code, notes, and snippets.

View HotelCalifornia's full-sized avatar
🏩
🏳️‍🌈🏳️‍⚧️

Hannah Brooke HotelCalifornia

🏩
🏳️‍🌈🏳️‍⚧️
View GitHub Profile
Hit:1 https://repos.sonar.digitalocean.com/apt main InRelease
Ign:2 http://ppa.launchpad.net/ubuntu-lxc/lxd-stable/ubuntu zesty InRelease
Ign:3 http://security.ubuntu.com/ubuntu zesty-security InRelease
Ign:4 http://nyc2.mirrors.digitalocean.com/ubuntu zesty InRelease
Err:5 http://security.ubuntu.com/ubuntu zesty-security Release
404 Not Found [IP: 91.189.88.152 80]
Ign:6 http://nyc2.mirrors.digitalocean.com/ubuntu zesty-updates InRelease
Err:7 http://ppa.launchpad.net/ubuntu-lxc/lxd-stable/ubuntu zesty Release
403 Forbidden
Ign:8 http://nyc2.mirrors.digitalocean.com/ubuntu zesty-backports InRelease
If intDice1Rnd = 1 And intDice2Rnd = 1 Then
txtRoll.Text = "Snake Eyes"
Else
If intDice1Rnd = 1 And intDice2Rnd = 2 Then
txtRoll.Text = "Ace Deuce"
Else
If intDice1Rnd = 1 And intDice2Rnd = 3 Then
txtRoll.Text = "Easy Four"
Else
If intDice1Rnd = 1 And intDice2Rnd = 4 Then
#include <stdint.h>
#include <stdio.h>
#define ENONE -999
typedef int Err;
// TODO: this isn't so much an optional type as it is a Result type, like in Rust. rename accordingly (e.g. Result->Value/Type;
// Option->Result)
typedef union {
int8_t i8;
int16_t i16;
// sanitize inputs
import "regexp"
func main() {
r := regexp.MustCompile(`[^a-zA-Z\s]`)
s := r.ReplaceAllString("input with emoji or non alphanumeric characters", "")
}
<!DOCTYPE html><html><head><style>body { margin: 0; }</style></head><body><script language="javascript"><!--
document.write('<scr'+'ipt language="javascript1.1" src="http://adserver.adtechus.com/addyn/3.0/9936.1/3462819/0/170/ADTECH;loc=100;target=_blank;key=key1+key2+key3+key4;grp=[group];misc='+new Date().getTime()+'"></scri'+'pt>');
//-->
</script><noscript><a href="http://adserver.adtechus.com/adlink/3.0/9936.1/3462819/0/170/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]" target="_blank"><img src="http://adserver.adtechus.com/adserv/3.0/9936.1/3462819/0/170/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]" border="0" width="300" height="250"></a></noscript></body></html>
use v6;
my constant CRLF = "\r\n";
my $listen = IO::Socket::INET.new(:listen, :localport(8080));
loop {
my $conn = $listen.accept;
say $conn.recv(1024);
$conn.print("HTTP/1.1 200 OK{CRLF}{CRLF}");
$conn.print('<h1>Hello World!</h1>');
$conn.close;
sub get-env {
%env = {};
%env<REQUEST_METHOD> = $.request-method;
%env<REQUEST_URI> = $.request-uri;
%env<SERVER_PROTOCOL> = $.request-version;
%env<SERVER_PORT> = $.server-port.Str;
%env<p6w.version> = Version.new('v0.7.Draft');
%env<p6w.url-scheme> = 'http';
%env<p6w.input> = $.input-supply;
%env<p6w.errors> = $.error-supplier;
class LocalServer {
my $.request-queue-size = 1;
my $.sock;
has $.server-addr;
has $.server-port;
method new(:$server-addr, :$server-port = 8080) {
self.bless(:$server-addr :$server-port);
$.sock = IO::Socket::INET.new(:listen, :localport($!server-port))
}
}
use v6;
my $CRLF = "\x0d\x0a";
my $listen = IO::Socket::INET.new(:listen, :localport(8080));
loop {
my $conn = $listen.accept;
say $conn.recv(1024);
$conn.print("HTTP/1.1 200 OK$CRLF");
$conn.print("Hello World!");
$conn.close;
Rust is ready to roll.
[01:35:09] root@HOTEL-BASE:~ **]#> mkdir rustproj
[01:42:24] root@HOTEL-BASE:~ **]#> cd rustproj/
[01:42:36] root@HOTEL-BASE:~/rustproj **]#> mkdir hello_world
[01:42:43] root@HOTEL-BASE:~/rustproj **]#> cd hello_world/
[01:42:47] root@HOTEL-BASE:~/rustproj/hello_world **]#> vi main.rs
[01:43:32] root@HOTEL-BASE:~/rustproj/hello_world **]#> rustc main.rs
Segmentation fault (core dumped)