Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* /iPhone webapp & Favicon
*/
if (!function_exists('xc1_favicon')) {
function xc1_favicon() {
if (file_exists ( CHILD_THEME_IMAGES_PATH . 'xc1-iphone.png' ))
$apple_icon = CHILD_THEME_IMAGES_URI . 'xc1-iphone.png';
else
$apple_icon = XC1_THEME_IMAGES_URI . 'xc1-iphone.png';
<!DOCTYPE html>
<html lang="en">
<head>
<title>Infinite slider</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
</head>
<body>
<ul id="splash-nav-ul">
<li id="left-arrow"><a class="back" href="#" title="Previous">&lt;</a></li>
-module(ehtml).
%-compile(export_all).
-export([ehtml_expand/1]).
%%%Nicked from YAWS
%% ------------------------------------------------------------
@parse
parse / gist:4655433
Created January 28, 2013 13:19
Identify tall iOS devices (e.g. iphone 5) in Corona/Lua
isTall = ( "iPhone" == system.getInfo( "model" ) ) and ( display.pixelHeight > 960 )
--
-- Abstract: animated sprite or "movieclip" library
-- This library assembles animation sequences from individual image files. For more advanced
-- texture memory handling, see the "sprite sheet" feature in Corona Game Edition.
--
-- Version: 2.01
--
-- Modified by Michael Hartlef, June 12th, 2010
-- Added setSpeed method, which sets the speed of animation.
@parse
parse / gist:5094464
Created March 5, 2013 21:30
Fox algorithm output
n = 1000
t = 1
Time: 0.000726, Threads used: 1
Time: 0.000699, Threads used: 1
-- Code created by Kwik - Copyright: kwiksher.com
-- Version: 2.2.5
module(..., package.seeall)
function new()
local numPages = 3
local menuGroup = display.newGroup()
local dispose
local _W = 1536
local _H = 2048
@parse
parse / AppDelegate
Created April 2, 2013 15:25
Remove menu toolbar in keyboard on UIWebView. Credit to photokandyStudios
- (void)webViewDidFinishLoad:(UIWebView*)theWebView
{
// Black base color for background matches the native apps
theWebView.backgroundColor = [UIColor blackColor];
// Register for notification center
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
@parse
parse / gol.erl
Last active February 23, 2016 09:45
Game of Life implementation in Erlang.
-module(gol).
-export([gol/3,timer/1,cell/6]).
% Main program
gol(W,H,Alive) ->
frame:init(),
frame:set_head("Conway's Game of Life in Erlang"),
frame:set_foot("By Jonatan and Anders"),
frame:set_w(W),
frame:set_h(H),
@parse
parse / matrixmult.c
Created January 28, 2013 13:18
Simple matrix multiplication
#include <stdio.h>
typedef struct {
int nrows, ncols;
float *data;
} matrix_t;
float constC(int i, int j, matrix_t A, matrix_t B) {
int k;
float res = 0.0;