Skip to content

Instantly share code, notes, and snippets.

View kamwing's full-sized avatar
🥑
Work smarter not harder

Ngai Kam Wing kamwing

🥑
Work smarter not harder
View GitHub Profile
server {
listen 80;
server_name localhost;
access_log /path/to/log/access.log;
error_log /path/to/log/error.log;
location / {
root /path/to/root;
index index.php;
@designermonkey
designermonkey / A-Symphony-Workflow.markdown
Created February 17, 2011 00:51
Just mapping out a git workflow for Symphony development

A Symphony Workflow

I'm describing my workflow in these articles, before I start my next Symphony project. Mostly for myself, to iron out my recurring problems, it is based on solid git techniques, taking heed of advice learned from Symphony community members, many many tips on the web, and flicking through the pages of O'Reilly's Version Control with git.

The core aim of this article, is to get a good Symphony development and deployment environment using git as the basis for the organisation, and have it written down for reference.

This workflow can be applied to any project, in theory, that has a starting point being a private remote git repo.

Disclaimer

@meleyal
meleyal / reveal.css
Created March 26, 2011 09:10
Apple.com reveal fx
body { background:url(http://images.apple.com/global/elements/quicktime/loading.gif) no-repeat 50% 150px; }
body.loaded { background:transparent; }
#showcase .content,
#promobar,
#itunes,
#globalfooter { opacity:0; -webkit-transition:opacity .5s; -moz-transition:opacity .5s; }
.loaded #showcase .content,
.loaded #promobar,
@wastemobile
wastemobile / A-Symphony-Workflow.markdown
Last active September 29, 2015 19:28 — forked from designermonkey/A-Symphony-Workflow.markdown
在安裝 Symphony CMS 之前,預先準備好三重主機(開發、測試、正式)的環境,主要是理解 Symphony 如何處理 Manifest 目錄的原理,就能順利規劃工作流程。但事情並不單純,若是安裝過程中移除了安裝檔(為了安全),後續的升級就會出現問題;資料庫的整合也不太容易。總而言之,Symphony CMS 在升級與部署這兩部分,還需要認真思考、並導入更便利的程序才行。

Symphony CMS 工作流程

原文是 John Porter 寫的《A Symphony Workflow》,參考了許多網路上的文章以及 O'Reilly's Version Control with git 一書的內容。

目的是建置一個 Symphony CMS 的開發與部屬環境,規範自己的工作方式,同時作為未來每一專案的開發基礎。

ps.Symphony CMS 確實只是個 PHP 的程式,而 PHP 的部署又遠比其他程序簡單,但 Symphony CMS 之所以部署起來複雜的原因,是因為使用了 git submodules 管理所有的外掛,外掛的安裝有可能會修改資料庫結構。Symphony CMS 的升級流程遠比想像中複雜難搞,這可能是未來的 Symphony CMS 必須審慎思考並重新架構的環節。

免責聲明

@wastemobile
wastemobile / EventTutorial.md
Created April 20, 2012 16:50 — forked from brendo/EventTutorial.md
Symphony Events: A Detailed Look

Forms have been an integral part of any interactive site since the dawn of time, they promote interactivity and are usually the most common way users interact with a site. It's commonplace that when a form is submitted, the website will take 'action' and do something with the data and then provide a user with the result. Symphony provides this logic layer via Events.

「輸入表單」一直以來都是動態網站的重要部分,表單也提供了最基本的互動功能。最常見的就是當使用者提交一個表單之後,網站會執行某種「動作」、做了某些事,接著將結果呈現在使用者眼前。Symphony CMS 透過「事件(Events)」提供這樣的邏輯層。

This tutorial assumes you have a basic understanding of how Events work in Symphony (if not, this may be a good introduction) and are semi comfortable writing some PHP code. I'll be showing you some of the lesser known features of Symphony Events, including event priority, event chaining and a brief demonstration of how to write a custom Event. The difficulty level progresses as we go through, but with any luck you'll be able to learn a thing or two :)

這份教學文章假設你已經對

if (typeof (AC) === "undefined") {
AC = {}
}
AC.ImageReplacer = Class.create({
_defaultOptions: {
listenToSwapView: true,
filenameRegex: /(.*)(\.[a-z]{3}($|#.*|\?.*))/i,
filenameInsert: "_☃x",
ignoreCheck: /(^http:\/\/movies\.apple\.com\/|\/105\/|\/global\/elements\/quicktime\/|_(([2-9]|[1-9][0-9]+)x|nohires)(\.[a-z]{3})($|#.*|\?.*))/i,
attribute: "data-hires",
if (typeof AC == "undefined") {
AC = {}
}
if (typeof iScroll !== "undefined") {
AC.iScroll = window.iScroll;
AC.iScroll.prototype = Object.extend(Object.clone(window.iScroll.prototype), {
isTouch: function () {
return (AC.Detector.isMobile() || AC.Detector.isiPad())
},
touchStart: function (c) {
@kamwing
kamwing / zsh.md
Created October 27, 2012 03:42 — forked from wenzowski/zsh.md
Oh my zsh in Ubuntu 12.04

Getting zsh to work in ubuntu:

Install zsh

sudo apt-get install zsh

nb. on a Vagrant VM, the default user (vagrant) has password vagrant.

Install oh-my-zsh

@johnvilsack
johnvilsack / es.sh
Created December 3, 2012 23:18
Install ElasticSearch on Ubuntu 12.10
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.11.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@albertein
albertein / move.js
Last active November 28, 2022 11:42
Move an element frome an array up or down.
var move = function(array, element, delta) {
var index = array.indexOf(element);
var newIndex = index + delta;
if (newIndex < 0 || newIndex == array.length) return; //Already at the top or bottom.
var indexes = [index, newIndex].sort(); //Sort the indixes
array.splice(indexes[0], 2, array[indexes[1]], array[indexes[0]]); //Replace from lowest index, two elements, reverting the order
};
var moveUp = function(array, element) {
move(array, element, -1);