Skip to content

Instantly share code, notes, and snippets.

@mangreen
mangreen / AdPlay Environment Setup
Last active August 29, 2015 14:06
AdPlay Environment Setup
1. 安裝VirtualBox
2. 安裝 Vagrant
3. 建立Bitbucket帳號
4. 安裝 SourceTree
5. 建立資料夾 [安裝目錄] /workspace/ubuntu/
@mangreen
mangreen / Youtube Get Current Second Api Demo.
Last active August 26, 2021 02:04
Youtube Get Current Second Api Demo.
<!DOCTYPE html>
<html>
<body>
<!-- 1. The <iframe> (and video player) will replace this <div> tag. -->
<div id="player"></div>
<div>Current Time: <span id="time"></span></div>
<script>
// 2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
@mangreen
mangreen / zsh.md
Last active August 29, 2015 14:13 — forked from tsabat/zsh.md
@mangreen
mangreen / Load local AngularJS if CDN fails
Last active August 29, 2015 14:14
JavaScript: Falling back to a local version of AngularJS if the CDN version fails to load
<!-- attempt to load AngularJS from CDN -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script>
<!-- if AngularJS fails to load fallback a local version -->
<script>window.angular || document.write('<script src="assets/js/angular.min.js"><\/script>');</script>
<!-- jQuery Ver. -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
window.jQuery || document.write('<script src="../components/jquery/dist/jquery.min.js"><\/script>')
@mangreen
mangreen / 資料庫緩存nodejs+redis+db
Last active August 29, 2015 14:14
資料庫緩存nodejs+redis+db
思路:
1.redis緩存我們業務需要的數據(有生命週期),以減輕數據庫的壓力,當查詢數據時,先走redis,redis沒有數據走數據庫,同時把得到的數據存入redis;
2.當數據發生delete或者update操作時,刪掉redis中的數據,同時更改數據庫。
注意的地方:第一步中,從數據庫中取數據存入redis,redis存儲失敗成功不重要。第二步中,必須等redis中清楚數據成功以後才能更改數據庫,不然下次取數據就會有問題。
//存儲緩存
YY.get_cache = function(self, tablename, where, row, args) {
if (tablename === 'card' ) {
@mangreen
mangreen / BDD Test
Created February 7, 2015 10:01
BDD Test
Web AdPlay Test
===============
This project is a collection of functional tests (integration tests) of AdPlay HTML5 product series.
Environment are assume to be under control, which means:
- you're under good network environment
- cloud are ready and we wouldn't run out of VM
- your computer are not busy with other CPU bound tasks
@mangreen
mangreen / app.js
Last active September 14, 2015 07:26 — forked from joshkurz/app.js
wysiHtml5 angular plugin
var demoApp = angular.module('demoApp', ['ngResource'], function($locationProvider) {
$locationProvider.hashPrefix('');
});
function MainCtrl($scope, Serv) {
$scope.selectedItem = {
value: 0,
label: ''
};
$scope.Wrapper = Serv;
@mangreen
mangreen / 00.howto_install_phantomjs.md
Last active August 29, 2015 14:27 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@mangreen
mangreen / Front-end-Developer-Interview-Questions-TC.md
Created November 19, 2015 16:04 — forked from hanksudo/Front-end-Developer-Interview-Questions-TC.md
Front-end-Developer-Interview-Questions - 前端工程師面試問題集(繁體中文版)

前端工程師面試問題集

@版本 2.0.0

譯注:此翻譯版,主要給不能流利的讀英文的人看,相關專有名詞還是保留原文。翻譯不好地方請協助pull request.

此repository包含了一些前端開發的面試問題,來審查一個有潛力的面試者。這並不是建議你對同一個面試者問上所有的問 (那會花費好幾小時)。從列表中挑幾個題目,應該就夠幫助你審查面試者是否擁有你需要的技能。

Rebecca MurpheyBaseline For Front-End Developers 也是一篇很棒且值得讀的文章在你開始面試之前。