Skip to content

Instantly share code, notes, and snippets.

View vadixidav's full-sized avatar
🦀
Rust ❤️

Geordon Worley vadixidav

🦀
Rust ❤️
  • Austin, TX
  • 23:41 (UTC -05:00)
View GitHub Profile
extern crate rand;
mod text;
fn main() {
use rand::SeedableRng;
let mut lex = text::Lexicon::new(rand::Isaac64Rng::from_seed(&[1, 2, 3, 4]));
let nowhere = lex.source("nowhere".to_string());
let nobody = lex.author(nowhere.clone(), "nobody".to_string());
let message = lex.tell(nowhere.clone(), nobody, "nothing".to_string());
Category:
Cocategory:
nothing ~ nothing is bad
everything ~ everything is good
nothing ~ nothing is good
Category:
Cocategory:
good ~ everything is good
bad ~ nothing is bad
good ~ nothing is good
use std::rc::Rc;
use std::cell;
use std::ops::{Deref, DerefMut};
pub struct SCell<T>(Rc<cell::RefCell<T>>);
pub struct Ref<'a, T: 'a>(cell::Ref<'a, T>);
pub struct RefMut<'a, T: 'a>(cell::RefMut<'a, T>);
impl<T> SCell<T> {
// Iterate forwards weaving between messages and adding instances to the vec
while let Some(i) = {instances.back().unwrap().borrow().next_instance()} {
instances.push_back(i);
}
// Iterate forwards weaving between messages and adding instances to the vec
loop {
let ins = instances.back().unwrap().borrow().next_instance();
if let Some(i) = ins {
instances.push_back(i);
}
}
$ iverilog -g2012 -t null -I src/ src/core0.sv
src/core0.sv:7: syntax error
src/core0.sv:5: Errors in port declarations.
src/core0.sv:21: syntax error
src/core0.sv:21: error: Invalid module instantiation
src/core0.sv:22: error: Invalid module instantiation
src/core0.sv:23: error: Invalid module instantiation
#pragma once
#include "../../../Utilities/BitField.h"
union spu_opcode_t
{
u32 opcode;
bf_t<u32, 0, 7> rt; // 25..31, for 3-op instructions
bf_t<u32, 0, 7> rc; // 25..31
#pragma once
#include "../../../Utilities/BitField.h"
union spu_opcode_t
{
u32 opcode;
bf_t<u32, 0, 7> rt; // 25..31, for 3-op instructions
bf_t<u32, 0, 7> rc; // 25..31
#!/bin/bash
CLIENT_ID="e442433569512b1"
CLIENT_SECRET="b088d1efe225fb9cfa8bad79290a77209c13de5e"
EXPIRE_TIME="3500"
CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/imgur"
mkdir -p "$CACHE_DIR"
ACCESS_TOKEN_FILE="$CACHE_DIR/token-access"
REFRESH_TOKEN_FILE="$CACHE_DIR/token-refresh"
#!/bin/bash
filename=$(date +%s).png
import "${filename}"
echo "${filename}"
imgur dTKCq "${filename}"