Skip to content

Instantly share code, notes, and snippets.

<?php
/* Silex form builder 檔案 */
$form = $app->form ()
->add ('submit', SubmitType::class, ['block_name' => 'buttons_start'])
->add ('reset', ResetType::class, ['block_name' => 'buttons_end'])
->getForm ();
{# HTML + Twig 樣板檔案 - 先單獨顯示 submit / reset,再用 form_reset 處理其他的 #}
{{ form_start(form) }}
<div class="form-group">
<div class="col-sm-2"></div>
<div class="col-sm-10">
{{ form_widget(form.submit) }}
{{ form_widget(form.reset) }}
{# HTML + Twig - 依序處理 form.field, 並特別處理 submit / reset #}
{{ form_start(form) }}
{{ form_row(form.field_A) }}
{{ form_row(form.field_B) }}
{{ form_row(form.field_C) }}
<div class="form-group">
<!-- HTML 輸出檔案 - submit / reset 按鈕在同一個區塊裡 -->
<form>
<!-- 其他欄位資料 -->
<div class="form-group">
<div class="col-sm-2"></div>
<div class="col-sm-10">
@wake
wake / install-comodo-ssl-cert-for-nginx.rst
Created November 28, 2016 08:14 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@wake
wake / ssp.class.php
Created November 29, 2014 17:25
SSP class for handling Asia characters
<?php
/*
* Helper functions for building a DataTables server-side processing SQL query
*
* The static functions in this class are just helper functions to help build
* the SQL used in the DataTables demo server-side processing scripts. These
* functions obviously do not represent all that can be done with server-side
* processing, they are intentionally simple to show how it works. More complex
* server-side processing operations will likely require a custom script.
@wake
wake / csh.cshrc
Last active October 16, 2021 09:21
# $FreeBSD: src/etc/csh.cshrc,v 1.3.50.1 2008/10/02 02:57:24 kensmith Exp $
#
# System-wide .cshrc file for csh(1).
# A righteous umask
umask 22
set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/X11R6/bin $HOME/bin)
set path = ($path ~/bin .)
@wake
wake / HOWTO.md
Last active December 21, 2019 07:47
Custom Gitlab webhook

How to add issue comment (note) webhook

Edit file app/services/notification_service.rb

add below code to the end of function new_note

    # ignore gitlab service messages starts with _Status changed to closed
    return true if note.note =~ /\A_Status changed to closed/
@wake
wake / redmine-plugins-my-update.md
Last active December 22, 2015 11:39
Redmine ( and plugins ) My Update

Redmine Plugins My Update


Upgrade RedmineCRM Finance plugin to make it possible relative with invoices in all projects

Open controller file

@wake
wake / centos-cloud9-installation.md
Last active December 18, 2015 22:08
Build Cloud9 on Linode CentOS 6.3 x64

Cloud9 Installation (Linode CentOS 6.2 x64)


Use Nginx front of node:

vi /etc/nginx/conf.d/cloud9.conf