Skip to content

Instantly share code, notes, and snippets.

use std::cast::transmute;
use std::libc::{size_t, c_long, c_void};
use std::vec;
enum CurlCode {
CURLE_OK = 0,
CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
CURLE_FAILED_INIT, /* 2 */
CURLE_URL_MALFORMAT, /* 3 */
@jmgrosen
jmgrosen / gist:5735727
Created June 8, 2013 16:25
Won't compile, gets "error: internal compiler error: translating unsupported cast."
use std::libc::{size_t, c_long};
use std::vec;
enum CurlCode {
CURLE_OK = 0,
CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
CURLE_FAILED_INIT, /* 2 */
CURLE_URL_MALFORMAT, /* 3 */
CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for
@jmgrosen
jmgrosen / shocked_rarity.py
Created January 21, 2013 04:06
ShockedRarity bot
import praw
import time
manspike = '(/manspike)'
rarishock = '[](/rarishock)'
reddit = praw.Reddit('Responds to (/manspike) on /r/mylittlepony with (/rarishock) '
'by /u/jmgrosen/')
reddit.login('ShockedRarity', '********')
import java.util.ArrayList;
import java.util.Random;
/**
* Created with IntelliJ IDEA.
* User: john
* Date: 1/14/13
* Time: 10:29 AM
* To change this template use File | Settings | File Templates.
*/

I can't figure out why this gives errors... Code:

/*-----------------------------------------------------------------------*/
/* Low level disk I/O module skeleton for FatFs     (C)ChaN, 2012        */
/*-----------------------------------------------------------------------*/
/* If a working storage control module is available, it should be        */
/* attached to the FatFs via a glue function rather than modifying it.   */
/* This is an example of glue functions to attach various exsisting      */
@jmgrosen
jmgrosen / gist:3875942
Created October 11, 2012 22:28
Display DASM code
; .file "main.c"
.text
.globl main
; .align 1
:main
SET PUSH, Y
SET PUSH, X
SUB SP, 0x1
SET X, 0x0
SET Y, X
@jmgrosen
jmgrosen / gist:3875922
Created October 11, 2012 22:25
Display C code
#include "display.h"
int main(void) {
while (1) {
for (int i = 0; i < 12; i++) {
puts_mod("Hello world", 0, i, (i + 1) << 12);
}
}
return 5;
}
JSR init_hardware
JSR main
:monitor
DAT 0x0000
:init_hardware
HWN I
:hw_loop
@jmgrosen
jmgrosen / gist:3875751
Created October 11, 2012 21:53
Organic Error
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
at Organic.Assembler.CreateListing (System.Collections.Generic.List`1 output) [0x00000] in <filename unknown>:0
at Organic.Assembler.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
at Organic.Assembler.CreateListing (System.Collections.Generic.List`1 output) [0x00000] in <filename unknown>:0
at Organic.Assembler.Main (System.String[] args) [0x00000] in <filename unknown>:0
@jmgrosen
jmgrosen / gist:1239987
Created September 24, 2011 23:27
Code for gui
package net.minecraft.src;
import net.minecraft.client.Minecraft;
import de.matthiasmann.twl.TextArea;
public class mod_TestGui extends BaseMod {
public KeyBinding keyTest = new KeyBinding("keyTest", 24);
public WidgetSimplewindow mainscreen;