Skip to content

Instantly share code, notes, and snippets.

View tombasche's full-sized avatar

Thomas Basche tombasche

  • Helsinki, Finland
View GitHub Profile
@tombasche
tombasche / stringReverse.s
Last active April 1, 2022 09:42
Run in Spim or Mars to reverse a string with assembler! (MIPS)
# Mips program to reverse a string
# mips.s
.data
str: .space 128 # character buffer
.text
.globl main
@tombasche
tombasche / json_error_catch.php
Created December 18, 2015 04:41
JSON Error Catch
<?php
/** \file jsonError.php
* \brief This code defines an error catch function to detect any errors in the JSON formatting. It converts the obscure code to the definition as provided in the JSON documentation.
* @see http://php.net/manual/en/function.json-last-error.php
*
*/
function jsonErrorCatch() {
switch (json_last_error())
{
//JSON_ERROR_DEPTH
@tombasche
tombasche / 0_reuse_code.js
Last active September 14, 2015 06:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console