Skip to content

Instantly share code, notes, and snippets.

View hikilaka's full-sized avatar
🤟

Zack Penn hikilaka

🤟
View GitHub Profile
use wgpu::{Buffer, BufferUsages, Device};
use wgpu::util::{BufferInitDescriptor, DeviceExt};
use crate::vertex::Vertex;
pub struct Mesh {
vertex_buffer: Buffer,
index_buffer: Buffer,
vertex_count: usize,
index_count: usize,
}
.program panic
set pindirs, 1
pull block
out y, 32
.wrap_target
mov x, y
set pins, 1
use async_std::{fs, path::Path, prelude::*};
use rand::{prelude::*, thread_rng};
use std::io::{Error, ErrorKind};
use wallpaper;
const WALLPAPER_DIR: &'static str = "/home/zack/Pictures/Wallpapers";
const ACCEPTED_EXTENSIONS: [&str; 3] = ["jpeg", "jpg", "png"];
async fn read_wallpapers() -> Result<Vec<String>, Error> {
let base_path = Path::new(WALLPAPER_DIR);
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_addition() {
let program = vec![
Operation::Store(0, 45),
Operation::Store(1, 30),
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
enum Stuff {
Array(Vec<u8>),
Number(u8),
}
#[derive(Serialize, Deserialize, Debug)]
import numpy as np
from matplotlib import pyplot
class Viewport:
def __init__(self, rng, *rest):
if len(rest) == 0:
self.array = [-rng, rng, -rng, rng]
elif len(rest) == 1:
self.array = [rng, rest[0]] * 2
const readline = require('readline')
const uuid = require('uuid/v4')
const knex = require('knex')({
client: 'sqlite3',
connection: { filename: './database.db' },
useNullAsDefault: true
})
const rl = readline.createInterface({
input: process.stdin,
macro_rules! hashmap {
($($key:expr => $value:expr), +) => ({
let mut map = std::collections::HashMap::new();
$(
map.insert($key, $value);
)+
map
});
}
#include <stdio.h>
#include <string.h>
int do_operation(int a, int b, char operator) {
switch (operator) {
case '+': return a + b;
case '-': return a - b;
case '*': return a * b;
case '/': return a / b;
default: return 0;
main(){char*a="abacbabcbbbcbabcbabc";while(*a)putchar(" #\n"[*a++-'a']);}