Skip to content

Instantly share code, notes, and snippets.

View pavlakis's full-sized avatar

Antonios Pavlakis pavlakis

View GitHub Profile
@pavlakis
pavlakis / PhpIMinifier-example1
Created December 28, 2011 21:05
pavlakis.info - initial configuration for PhpIMinifier
<?php
$yuiLocation = '/Users/antonis/Sites/yui/build/yuicompressor-2.4.8pre.jar';
$public = '/Users/antonis/Sites/branches/development/public/';
$version = '1112v3';
$css = $public . 'css/';
$js = $public . 'js/custom/';
$cssMinify = new PhpIMinifier($css, $version, 'css');
$cssMinify->setYuiCompressorExec($yuiLocation);
define([], function () {
return function (name, content) {
this.name = name,
this.content = content,
this.getHtml = function() {
return "<div class='slide' id='#" + this.name + "'>" + content + "</div>";
}
}
});
@pavlakis
pavlakis / model.js
Created February 3, 2013 19:12
Model for the slider example app
// slides model
define([], function () {
return function (containerId) {
this.containerId = containerId,
this.slideWidth = 400,
this.slidePosition = 0,
this.totalSlidesNo = 0,
@pavlakis
pavlakis / main.js
Created February 3, 2013 19:14
Loader script for slider example app
define(['slides/model', 'slides/slide'], function (model, slide) {
$(document).ready(function() {
var slidesModel = new model('slides_container');
slidesModel.addSlide(new slide('slide1', 'my first slide'));
slidesModel.addSlide(new slide('slide2', 'my second slide'));
slidesModel.addSlide(new slide('slide3', 'my third slide'));
slidesModel.addSlide(new slide('slide4', 'my fourth slide'));
@pavlakis
pavlakis / template.html
Created February 3, 2013 19:16
A simple template for the slider example app
<!DOCTYPE HTML>
<html>
<head>
<title>A simple slider with jQuery and curl.js</title>
<link rel="stylesheet" type="text/css" href="/jQuery_curl/styles/slides.css">
<script src="/jQuery_curl/lib/jquery/jquery-1.9.0.js" type="text/javascript"></script>
<script src="/jQuery_curl/lib/curl/curl.js" type="text/javascript"></script>
@pavlakis
pavlakis / slides.css
Created February 3, 2013 19:19
The css file for the slider example app.
@charset "UTF-8";
body{
background-color:#ffffff;
}
#container{
position:absolute;
left:0px;
top:0px;
@pavlakis
pavlakis / index.php
Created March 30, 2013 23:10
Start by creating public/index.php
<?php
// public/index.php
$path = realpath('../');
define('ROOT', $path);
include ROOT . '/Bootstrap.php';
@pavlakis
pavlakis / Bootstrap.php
Created March 30, 2013 23:11
Create your Bootstrap
<?php
require ROOT . '/vendor/autoload.php';
use App\HelloWorld;
$hello = new HelloWorld();
echo $hello;
@pavlakis
pavlakis / HelloWorld.php
Created March 30, 2013 23:12
This is a basic hello world example for the composer tutorial. App/HelloWorld.php
<?php
namespace App;
class HelloWorld
{
private $msg = 'Hello World';
public function __construct($msg = '')
@pavlakis
pavlakis / Hello.php
Created March 30, 2013 23:13
App/Layout/Hello.php
<html>
<head>
<title>Hello world with composer</title>
</head>
<body>
<p><?php echo $this->hello . '!'; ?></p>
</body>
</html>