Skip to content

Instantly share code, notes, and snippets.

$(document).ready(function(){
var limit=1;
$(":radio.voting").click(function(){
var count = $(":radio.voting:checked").size();
if(count>limit){
$(this).attr("checked",false);
return false;
}else{
return true;
$(".authBtn").live("click",function(){
var _this =this;
$.getJSON('auth_process.php?type=json',{Id:$(this).attr("id")},
function(ret) {
//成功
if(ret=="pass"){
$(_this).remove();
// console.log("啟用!!!");
}else if(ret=="fail"){
window.alert("驗證手續失敗請再試一次或刷新頁面!!!");
<?php echo (($field->widgetView($profile))?$field->widgetView($profile):CHtml::encode((($field->range)?Profile::range($field->range,$profile->getAttribute($field->varname)):$profile->getAttribute($field->varname)))); ?>
<?php echo (($field->widgetView($profile))?$field->widgetView($profile):CHtml::encode((($field->range)?Profile::range($field->range,$profile->getAttribute($field->varname)):$profile->getAttribute($field->varname)))); ?>
<?php
//應該是這樣
if($field->widgetView($profile)){
echo $field->widgetView($profile);
}else{
啟用上傳
$(function () {
$('.file_upload').each(function(){
var _this=this;
$(this).fileUploadUIX(
{
maxFileSize: 3000000, // Size in Bytes - 5 MB
maxNumberOfFiles: 1,
acceptFileTypes: /(png)|(jpe?g)|(gif)$/i,
1. 把檔案列表貼到 list.txt檔案裡面
2.打開終端機 到該目錄底下
3.鍵入 wget --referer=http://map.google.com -i list.txt
4. 執行 ruby change.rb
@crazylion
crazylion / hook.rb
Created September 21, 2011 16:19
change author
# location lib/plugins/assign_author/hook.rb
#如果使用者想要透過webservice指定作者的話,http 參數給予author_login即可。
# 此欄位為user table的 login欄位
module AssignAuthor
class Hooks < Redmine::Hook::ViewListener
def controller_issues_new_before_save(context={})
if context[:params]["author_login"]
u=User.find_by_login(context[:params]["author_login"])
@crazylion
crazylion / gist:1369427
Created November 16, 2011 06:32
init.d
#!/bin/bash
start(){
echo "start listening fssm"
/etc/xxx/listen.rb &
}
stop(){
echo "stop listening fssm"
killall listen.rb
(function(){
YAHOO.util.Get.script("http://code.jquery.com/jquery-1.7.1.min.js");
img_src=YAHOO.util.Dom.getStyle("mainImage","background-image");img_src=img_src.substring(5,img_src.length-2);
//console.log(img_src);
setTimeout(function(){
//console.log(jQuery("#mainImageLink"));
list=jQuery("#photoSizes li a");
var box=jQuery("#ajaxPhotoBox");
javascript:(function(){YAHOO.util.Get.script("https://raw.github.com/gist/1881074/2a9ffc1cc59c064d0b762c1156f9c30f6c4e02ee/gistfile1.js")})();
<?xml version="1.0" encoding="utf-8"?>
<DataSet xmlns="http://tempuri.org/">
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="Water_Station_ST_NO" type="xs:string" minOccurs="0" />