Skip to content

Instantly share code, notes, and snippets.

View cmichi's full-sized avatar

Michael Müller cmichi

View GitHub Profile
@cmichi
cmichi / jQuery-file-exists.js
Created November 30, 2010 22:56
Very simple way to check if a file exists, using jQuery.
/**
* Very simple way to check if a file exists on this domain.
* Use with the jQuery library.
*
* Important: Works only on the same domain.
* Cross-domain-requests have to be done in another way (see JSONP)!
*
* Use: console.log( "/data/list.json".fileExists() );
*/
String.prototype.fileExists = function() {
@cmichi
cmichi / get-xbm-pixel.c
Created March 16, 2011 23:56
Function which returns the pixel color for a XBM (X BitMap) Image
/*
* returns the pixel color for a XBM (X BitMap) image.
*
* XBM is a plain text monochrome image format that takes the form of
* C source code. images can directly be compiled into an application.
*
*/
static int is_black(int x, int y, int img_width, int img_height)
{
char byte_containing_px;

Keybase proof

I hereby claim:

  • I am cmichi on github.
  • I am cmichi (https://keybase.io/cmichi) on keybase.
  • I have a public key ASA8usPptGEMn6Gas6s9TUCx8eq2gsu_Fzr93c7fkb7uYQo

To claim this, I am signing this object: