Skip to content

Instantly share code, notes, and snippets.

@greglearns
greglearns / inference.rs
Created November 12, 2022 00:56 — forked from sciolizer/inference.rs
Rust inference feeling somewhat arbitrary
trait MyTrait {}
struct MyStruct;
impl MyTrait for MyStruct {}
fn compiles1() -> Box<dyn MyTrait> {
Box::new(MyStruct)
}
fn compiles2() -> Box<dyn MyTrait> {
[package]
name = "feedexplorer_api"
version = "0.1.0"
authors = ["Greg Edwards <greg@greglearns.com>"]
[dependencies]
rocket = "=0.2.9"
rocket_codegen = "=0.2.9"
rocket_contrib = "=0.2.9"
serde = "=0.9"
@greglearns
greglearns / default.nix
Last active February 13, 2019 20:39
NixOS default.nix for compiling Nightly Rust using Mozilla overlay, also with a specific RustRegistry for specific date, to handle "version not found" issues. Doesn't actually work, so do not use.
{
pkgs ? (
let
pkgs = import <nixpkgs>;
pkgs_ = (pkgs {});
rustOverlay = (pkgs_.fetchFromGitHub {
owner = "mozilla";
repo = "nixpkgs-mozilla";
rev = "1608d31f7e5b2415fb80b5d76f97c009507bc45f";
sha256 = "0mznf82k7bxpjyvigxvvwpmi6gvg3b30l58z36x192q2xxv47v1k";
@greglearns
greglearns / whowas
Created September 16, 2014 09:26
check domain availability
#!/bin/bash
if [ "$#" == "0" ]; then
echo "You need to supply at least one domain name!"
exit 1
fi
DOMAINS=(
'com' \
'me' \
@greglearns
greglearns / gist:c6072f47db58ddb4ba30
Created May 30, 2014 04:09
GT.M + Node.js on Ubuntu 14.04 via Vagrant
# using ubuntu/trusty64
sudo apt-get install fis-gtm -y
/usr/lib/fis-gtm/V6.0-003_x86_64/gtm -direct
sudo ln -s /usr/lib/fis-gtm/V6.0-003_x86_64/libgtmshr.so /usr/local/lib/libgtmshr.so
sudo ldconfig
sudo apt-get install npm -y
sudo apt-get install nodejs -y
# npm init
npm install -S nodem
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew update
brew doctor
brew update