Skip to content

Instantly share code, notes, and snippets.

@mobius
mobius / mathjax.html
Last active December 10, 2015 19:29
basic page of MathJax
<!DOCTYPE html>
<html>
<title> MathJax Tex Test Page</title>
<head>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(', '\\)']]},
processEscape: true,
TeX: { equationNumbers: { autoNumber: "AMS"}}
});
@mobius
mobius / forceinline.h
Created March 20, 2012 01:28
forceinline defines
#ifndef FORCEINLINE
#if defined(__GNUC__)
#define FORCEINLINE __inline __attribute__ ((always_inline))
#elif defined(_MSC_VER)
#define FORCEINLINE __forceinline
#endif
#endif
#ifndef NOINLINE
#if defined(__GNUC__)
#define NOINLINE __attribute__ ((noinline))
@mobius
mobius / min_ogl.c
Created March 11, 2012 12:37
minimum file for create a opengl context
/* An example of the minimal Win32 & OpenGL program. It only works in
16 bit color modes or higher (since it doesn't create a
palette). */
#include <windows.h> /* must include this before GL/gl.h */
#include <GL/gl.h> /* OpenGL header file */
#include <GL/glu.h> /* OpenGL utilities header file */
#include <stdio.h>
@mobius
mobius / libzip_simple.c
Last active May 19, 2024 10:47
using libzip to extract files
/* Copyright (C) 2011 rocenting#gmail.com */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/resource.h>
@mobius
mobius / Program.cs
Created May 31, 2011 04:28
C# startup a process in hidden mode
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
namespace RunAsHidden
{
class Program
{
@mobius
mobius / lisp_in_200_cpp_lines.cpp
Created December 1, 2010 02:56
Lisp interpreter in 200 lines
// Scheme Interpreter in 90 lines of C++ (not counting lines after the first 90).
// Inspired by Peter Norvig's Lis.py.
// Copyright (c) 2010 Anthony C. Hay. This program leaks memory.
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <map>