Skip to content

Instantly share code, notes, and snippets.

View marcoleong's full-sized avatar
🐒
productivity--

Marco Leong marcoleong

🐒
productivity--
View GitHub Profile
@marcoleong
marcoleong / deploy.rb
Created August 22, 2012 05:00
Sample deploy file for Capifony and works with MAMP
set :application, "Music Tube"
set :domain, "server.yourserver.com"
set :deploy_to, "~/www/serverfolder.yourserver.com"
set :app_path, "app"
set :repository, "git://github.com/yourname/yourrepo.git"
set :scm, :git
set :scm_verbose, true
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, or `none`
@marcoleong
marcoleong / gist:2034045
Created March 14, 2012 04:19
Symfony2 path operation

In twig

{{ path('article_show', { 'slug': article.slug }) }}

@marcoleong
marcoleong / gist:1979204
Created March 5, 2012 16:44
symfony2 authentication user, use this in controller
//...
if(!$this->get('security.context')->isGranted('IS_AUTHENTICATED_FULLY')){
throw new AccessDeniedException();
}
//...
$user = $this->get('security.context')->getToken()->getUser();
@marcoleong
marcoleong / bootstrap-scrollspy-horizontal.js
Created February 27, 2012 09:22
Modified bootstrap-scrollspy.js to support horizontal scroll.
/* =============================================================
* bootstrap-scrollspy.js v2.0.1
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
* =============================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@marcoleong
marcoleong / sample.lua
Created December 16, 2011 17:20
Lua cocos2d-x sample
require "hello2"
cocos2d.CCLuaLog("result is " .. myadd(3, 5))
-- create scene & layer
layerFarm = cocos2d.CCLayer:node()
layerFarm:setIsTouchEnabled(true)
layerMenu = cocos2d.CCLayer:node()
@marcoleong
marcoleong / Scene.cpp
Created December 16, 2011 08:19
Use this to load Lua
#include "tolua++.h"
#include "Scene.h"
char* Scene::getData() {
printf("Something %s",data);
return data;
}
void Scene::setData(const char* pData){
sprintf(data, "%s",pData);