Skip to content

Instantly share code, notes, and snippets.

View matheusdiogenesandrade's full-sized avatar

Matheus Diógenes Andrade matheusdiogenesandrade

View GitHub Profile
@peterspackman
peterspackman / mingw-w64-x86_64.cmake
Last active April 15, 2024 15:04
cmake toolchain file for mingw-w64 x86_64 builds on Ubuntu
# Sample toolchain file for building for Windows from an Ubuntu Linux system.
#
# Typical usage:
# *) install cross compiler: `sudo apt-get install mingw-w64`
# *) cd build
# *) cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-x86_64.cmake ..
# This is free and unencumbered software released into the public domain.
set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
@dgrigg
dgrigg / json_exception_helper.php
Created November 22, 2013 21:14
A CodeIgniter helper function for returning JSON errors messages to AJAX calls instead of standard HTML error page. Use the helper instead of having to override the core Exception class.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
function show_json_error($message, $status_code = 500, $status_message = '')
{
header('Cache-Control: no-cache, must-revalidate');
header('Content-type: application/json');
set_status_header($status_code, $status_message);
echo json_encode(