Skip to content

Instantly share code, notes, and snippets.

# 簡單一句話描述你的問題
## 你的執行環境
## 瀏覽器是什麼
## 如何重現這個 issue?
1. 到 xxx 頁面後點按 xxx 按鈕
2. click 後顯示lightbox
3. ....
@winwu
winwu / all.js
Created January 26, 2016 06:26
scrollbaranddeletectie.js
// http://stackoverflow.com/questions/19999388/check-if-user-is-using-ie-with-jquery
function detectIE() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf('MSIE ');
if (msie > 0) {
// IE 10 or older => return version number
return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
}
// 檔名叫做 startup.js
if (Meteor.isClient) {
Meteor.startup(function(){
//參考自 http://stackoverflow.com/questions/18754020/bootstrap-3-with-jquery-validation-plugin
$.validator.setDefaults({
highlight: function(element) {
$(element).closest('.form-group').addClass('has-error');
},
unhighlight: function(element) {
$(element).closest('.form-group').removeClass('has-error');
Template.yourTemplateName.events({
'submit #some-form': ( event ) => event.preventDefault()
});
Template.yourTemplateName.onRendered(function(){
$('#some-form').validate({
rules: {
datetime: {
required: true,
date: true
@winwu
winwu / router.js
Last active December 15, 2015 08:46
meteor scrolltop when page onload
/* Source from https://github.com/tmeasday/meteor-router/issues/71#issuecomment-51592305 START */
Router._filters = {
resetScroll: function () {
var scrollTo = window.currentScroll || 0;
$('body').scrollTop(scrollTo);
$('body').css("min-height", 0);
}
};
@winwu
winwu / 01_Laravel 5 Simple ACL manager_Readme.md
Last active August 29, 2015 14:26 — forked from amochohan/01_Laravel 5 Simple ACL manager_Readme.md
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@winwu
winwu / laravel5-file-upload.view.blade.php
Created August 1, 2015 03:19
Laravel-檔案上傳-html-sample.php
{!! Form::open(array(
'route' => 'media.store',
'class' => 'form-horizontal',
'id' => 'media-frm',
'method'=>'POST',
'files'=>'true' ))
!!}
<!--單檔上傳請用這個 Form::file -->
{!! Form::file('photo') !!}
@winwu
winwu / laravel5-file-upload-single.php
Created August 1, 2015 03:14
Laravel5-檔案上傳-單檔上傳.php
<?php
use App\Http\Controllers\Controller;
use App\Media;
use Validator;
use Request;
use Response;
use Uuid;
@winwu
winwu / laravel5-file-upload-multiple.php
Last active January 13, 2017 04:44
Laravel5-檔案上傳-多檔上傳.php
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Media;
use Validator;
use Request;
use Response;
//use Uuid;
@winwu
winwu / web_development_with_laravel_5.md
Last active August 29, 2015 14:26 — forked from jaceju/web_development_with_laravel_5.md
Laravel 5 測試起手式

Web Development with Laravel 5

目標

如何在開發的過程中加入測試。

  1. Model
  2. Repository
  3. Controller
  4. Auth