Skip to content

Instantly share code, notes, and snippets.

View autarch's full-sized avatar

Dave Rolsky autarch

View GitHub Profile
#[inline_props]
pub(crate) fn MenuItem(
cx: Scope,
text: &'static str,
href: &'static str,
title: &'static str,
) -> Element {
let location = use_route(&cx).current_location();
let is_active = location.path() == *href;

If you've programmed in Perl for long enough, you've probably needed to reach for a faster language from time to time, like C or C++. And if you've done that, you also know why so many people prefer high-level languages like Perl to low-level languages like C or C++!

Rust is a low-level language that has been voted the most-loved programming language in the Stack Overflow survey for six years straight. This talk aims to show you why.

Rust brings several interesting features to low-level programming. Rust uses its borrow checker to enforce memory and thread safety without a garbage collector, and with no need for manual malloc and free calls. It also features an advanced type system that requires you to explicitly handle errors, eliminates the billion dollar null pointer mistake, and allows you to express complex constraints that can be enforced at compile-time through type definitions.

This talk will cover some of the most interesting features of Rust, complete with code examples. There's not enough to tea

#[inline_props]
pub(crate) fn MenuItem(
cx: Scope,
text: &'static str,
href: &'static str,
title: &'static str,
) -> Element {
let location = use_route(&cx).current_location();
let is_active = location.path() == *href;
let mut classes: Vec<_> = vec![
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
--> web-frontend/src/artists.rs:6:9
|
6 | &cx,
| ^^^
|
note: first, the lifetime cannot outlive the anonymous lifetime defined here...
--> web-frontend/src/artists.rs:4:27
|
4 | pub(crate) fn Artists(cx: Scope) -> Element {
#!/usr/bin/env perl
use v5.24;
use strict;
use warnings;
use autodie qw( :all );
use LWP::UserAgent;
use Mojo::DOM;
use Path::Tiny qw( tempfile );
@autarch
autarch / q.pl
Created December 16, 2021 19:16
use v5.24;
use strict;
use warnings;
use Getopt::Long;
sub main {
my $count;
GetOptions( 'count:i' => \$count );
$count //= 2;
@autarch
autarch / mod.rs
Last active November 6, 2021 17:00
// icons/mod.rs
use crate::Msg;
use seed::{prelude::*, *};
use typed_builder::TypedBuilder;
#[derive(TypedBuilder)]
#[builder(doc)]
pub struct Icon {
path: Attrs,
#[builder(default = 20)]

GSoD 2021 Proposal: Audit Perl's documentation

​ This document presents a project proposed by The Perl Foundation for Google's 2021 Season of Docs program. ​

About Perl (and its docs)

Perl is a free, open-source, general-purpose programming language originally developed by Larry Wall in the 1980s. Fast, flexible, and expressive, Perl quickly found its way onto just about every Unix-derived operating system (and then some). ​ During the 1990s, Perl’s ubiquity and ease of use played an integral role in the explosive growth of the infant Web. Today, Perl enjoys ongoing maintenance and development thanks to a core team of volunteers. It remains a part of countless computers' internal toolkits, and continues to power software including critical operating system features, websites of every sort, and myriad creative hobby projects. ​

package Script::SqitchReset;
use v5.24;
use strict;
use warnings;
use feature 'postderef', 'signatures';
use autodie qw( :all );
use namespace::autoclean;
pub mod ast;
pub mod error;
pub mod parser;
use env_logger;
fn main() -> Result<(), error::PGQueryError> {
env_logger::init();
let sql = "CREATE TABLE foo (