Skip to content

Instantly share code, notes, and snippets.

-- Table based object with method
function newPerson(name)
local M = {
name = name,
age = 0,
}
M.greet = function (self)
print ("This is " .. self.name .. ", I am " .. self.age)
local composer = require( "composer" )
local scene = composer.newScene()
-- include Corona's "physics" library
local physics = require "physics"
function scene:create( event )
-- Called when the scene's view does not exist.
--
-- INSERT code here to initialize the scene
@tomekc
tomekc / puzzle15.html
Created June 8, 2014 20:33
15-puzzle stub
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="">
<style type="text/css">
* {
@tomekc
tomekc / SwiftNinja2.swift
Created August 5, 2014 09:10
Solution to Ray Wenderlich's Swift Ninja challenge
// Solution to ultimate Swift Nija challenge
// http://www.raywenderlich.com/77845/swift-ninja-part-2
enum Suit {
case Clubs, Diamonds, Hearts, Spades
}
enum Rank {
case Jack, Queen, King, Ace
case Num(Int)
@tomekc
tomekc / dabblet.css
Created July 23, 2012 09:44
Untitled
* {
font-family: arial;
}
.diw {
border-radius: 10px;
width: 200px;
margin: auto;
}
@tomekc
tomekc / crashlog.txt
Created September 6, 2012 22:09
Ingredients.app crash log
Process: Ingredients [63019]
Path: /Applications/Ingredients.app/Contents/MacOS/Ingredients
Identifier: net.fileability.ingredients
Version: 1.0 (1.0)
Code Type: X86-64 (Native)
Parent Process: launchd [282]
User ID: 501
Date/Time: 2012-09-07 00:05:09.957 +0200
OS Version: Mac OS X 10.8.1 (12B19)
//: Playground - noun: a place where people can play
// 1. Create new iOS playground
// 2. Paste this code
// 3. Enable timeline slider (on Utilities panel, alt+cmd+0 to show)
// 4. After letting the animation play, move the slider :)
import UIKit
import XCPlayground
@tomekc
tomekc / pom.xml
Created November 7, 2012 08:53 — forked from codahale/pom.xml
Take this and save it as pom.xml in your project directory.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!-- none yet -->
@tomekc
tomekc / app.rb
Last active October 12, 2015 16:07
Sinatra kickstart boilerplate: HTML5 + Bootstrap + jQuery
require 'sinatra'
get '/' do
@name = ENV['USER']
erb :main
end
@tomekc
tomekc / CoronaSDK-Snippets.lua
Created December 3, 2015 23:58
Handy Corona SDK snippets for games
-- Disable pixel smoothing
display.setDefault( "magTextureFilter", "nearest" )
-- Physics debugging: place in scene file in global scope
physics.setDrawMode( "hybrid" )