Skip to content

Instantly share code, notes, and snippets.

View OzuYatamutsu's full-sized avatar
😺
Myeh!!

Sean Collins OzuYatamutsu

😺
Myeh!!
View GitHub Profile
<?php
require '/var/www/scripts/directoryToArray.php';
function getRandomCatPicture() {
$expFileArray = shuffle(loadExpressions());
$index = 0;
$file = "";
while (strpos(pathinfo($expFileArray[$index], PATHINFO_FILENAME), 'cat') === false) {
$index += 1;
module Pipeline12Register_Test();
parameter CLOCK_PERIOD = 20; // ns
parameter BIT_WIDTH = 32;
parameter REGSEL_BITS = 4;
reg clk, reset;
reg [REGSEL_BITS - 1:0] r1, r2, r_dest;
reg [BIT_WIDTH - 1:0] r1_out, r2_out, alu_out;
reg isBranch, isJump, toReg, toMem;
wire [BIT_WIDTH - 1:0] p12_r1_out, p12_r2_out, p12_alu_out;
; BREAK
Debug_Break:
; Display the value of t0 on HEX
; Display the value of t1 on LEDR
sw t0,OFSHEX(gp)
sw t1,OFSLEDR(gp)
bt t0,t0,Debug_Break
assign pcIn = (opcode == 11) ? (reg_read_data1 + (4 * imm))
: (branch && alu_result) ? pcOut + INST_SIZE + (4 * imm)
: pcOut + INST_SIZE;
.NAME IOBASE= 0xF0000000
.NAME OFSHEX= 0x00000000
.NAME OFSLEDR=0x00000004
.NAME OFSLEDG=0x00000008
.ORIG 0x40
AtZero:
; Display 0xFF on LEDG
mvhi gp,IOBASE
andi s0,s0,0
@OzuYatamutsu
OzuYatamutsu / ArES.py
Last active October 22, 2015 00:20
THE BEST ENCRYPTION SCHEME MYAN
# coding=utf-8
# Arr Encryption Standard (ArES)
# A R R
from sys import argv
key2_array = ['a', 'r', 'r']
def arr_encrypt(plaintext, key):
output = []
for index in range(0, len(plaintext)):
// daysuntil.js
// (C) 2012+ by Steakscorp Labs and Jinhai Steakhouse
// Calculates the number of days between two dates, or
// the number of days between today and some date in
// the future
// Number of milliseconds per day
const ONE_DAY = 86400000;
const MONTHS = ["January", "February", "March", "April", "May",
#!/bin/bash
mount | grep '/var/motion-captures type fuse.sshfs'
if [ $? -ne 0 ]; then
echo "No SSHFS connection to Steakscorp Core - attempting mount"
sshfs pir2-camera@steakscorp.org:/home/pir2-camera/camera-output /var/motion-captures -o nonempty
if [ $? -ne 0 ]; then
echo "FAILURE - Can't connect to Steakscorp Core - not starting motion"
exit 1
fi
@OzuYatamutsu
OzuYatamutsu / network-heartbeat.py
Created October 9, 2015 12:51
Quick and dirty network refresh script to deal with crappy Rpi network adapter
from subprocess import call
from urllib import request
REF_URL = 'https://google.com'
def main():
if not check_connectivity(REF_URL):
print("NO INTERNET - Attempting to refresh wlan0")
call(["ifdown", "wlan0"])
call(["ifup", "wlan0"])
/**
* Converts an input string to a fixed-width string.
*/
function stringToFixedLength(input) {
var output = "";
for (var i = 0; i < input.length; i++) {
/* Ignore newline characters */
if (input.charAt(i) == "\n") {
output = output + "<br />";