This file contains hidden or 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
| use std::marker::PhantomPinned; | |
| use std::ops::Deref; | |
| use std::pin::{Pin, pin}; | |
| struct NoMove(i32, PhantomPinned); | |
| impl Deref for NoMove { | |
| type Target = i32; | |
| fn deref(&self) -> &Self::Target { |
This file contains hidden or 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
| #![feature(rustc_private)] | |
| extern crate rustc_hir; | |
| extern crate rustc_middle; | |
| // Doesn't work. | |
| use rustc_hir::intravisit::Visitor; | |
| use rustc_middle::ty::TyCtxt; | |
This file contains hidden or 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
| #!/bin/bash | |
| ssid=$(networksetup -getairportnetwork en0 | cut -d ":" -f 2 | sed "s/^[ \t]*//") | |
| sudo airport -z | |
| sudo ifconfig en0 ether $(openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.\$//") | |
| networksetup -setairportnetwork en0 "$ssid" |
This file contains hidden or 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
| use std::io::prelude::*; | |
| use std::thread; | |
| use std::net::{TcpStream, TcpListener}; | |
| fn network_process() { | |
| let listener = TcpListener::bind("127.0.0.1:1337").unwrap(); | |
| let mut handlers = Vec::new(); | |
| match listener.accept() { | |
| Ok((mut socket, addr)) => { |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # Remove all gems EXCEPT defaults :) | |
| `gem list -d`.split(/\n\n^(?=\w)/).each do |data| | |
| match = data.match(/(?<name>([^\s]+)) \((?<versions>.*)\)/) | |
| name = match[:name] | |
| versions = match[:versions].split(', ') | |
| if match = data.match(/^.*\(([\d\.]*),? ?default\): .*$/) | |
| next if match[1].empty? # it's the only version if this match is empty |
This file contains hidden or 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
| #![feature(ip_addr, raw)] | |
| extern crate pnet; | |
| use std::net::{IpAddr, Ipv4Addr}; | |
| use pnet::transport::TransportChannelType::Layer4; | |
| use pnet::transport::TransportProtocol::Ipv4; | |
| use pnet::transport::transport_channel; | |
| use pnet::packet::ip::IpNextHeaderProtocols; | |
| use pnet::packet::Packet; |
This file contains hidden or 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
| # Commands to be executed directly by this shell. | |
| BUILTINS = {} | |
| # The builtin `cd` for changing the shell's working directory. | |
| BUILTINS['cd'] = lambda do |args| | |
| # Change to the home directory by default. | |
| args << ENV['HOME'] if args.empty? | |
| # Read the destination path, doing very basic path expansion. | |
| dest = args.pop.gsub(/~/, ENV['HOME']) |
This file contains hidden or 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
| #!/bin/sh | |
| alarm() { | |
| while :; | |
| do | |
| play ~/Loud_Alarm_Clock_Buzzer-Muk1984-493547174.wav | |
| done | |
| } | |
| while :; |
This file contains hidden or 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
| $ events --today | |
| ┍━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┑ | |
| │ Thursday 2020-10-08 │ | |
| ├─────────────────────────────────────────────────────────────────────────────┤ | |
| │ ▾ Groceries │ | |
| │ ☒ Coffee │ | |
| │ ▸ Readings (due: 10-20) │ | |
| └─────────────────────────────────────────────────────────────────────────────┘ | |
This file contains hidden or 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
| union U { | |
| u32: u32, | |
| u64: u64, | |
| f32: f32, | |
| f64: f64, | |
| } | |
| fn main() { | |
| let u32 = U { u32: 1 }; | |
| let u64 = U { u64: 1 }; |
NewerOlder