Skip to content

Instantly share code, notes, and snippets.

@mangreen
mangreen / AdPlay Environment Setup
Last active Aug 29, 2015
AdPlay Environment Setup
View AdPlay Environment Setup
1. 安裝VirtualBox
2. 安裝 Vagrant
3. 建立Bitbucket帳號
4. 安裝 SourceTree
5. 建立資料夾 [安裝目錄] /workspace/ubuntu/
@mangreen
mangreen / Youtube Get Current Second Api Demo.
Last active Jul 14, 2020
Youtube Get Current Second Api Demo.
View 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');
View zsh.md

Prereq:

apt-get install zsh
apt-get install git-core

Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
@mangreen
mangreen / Load local AngularJS if CDN fails
Last active Aug 29, 2015 — forked from simonbingham/gist:5622654
JavaScript: Falling back to a local version of AngularJS if the CDN version fails to load
View Load local AngularJS if CDN fails
<!-- 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 Aug 29, 2015
資料庫緩存nodejs+redis+db
View 資料庫緩存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' ) {
View 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 Sep 14, 2015 — forked from joshkurz/app.js
wysiHtml5 angular plugin
View app.js
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 Aug 29, 2015 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu
View 00.howto_install_phantomjs.md

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 Nov 19, 2015 — forked from hanksudo/Front-end-Developer-Interview-Questions-TC.md
Front-end-Developer-Interview-Questions - 前端工程師面試問題集(繁體中文版)
View Front-end-Developer-Interview-Questions-TC.md

前端工程師面試問題集

@版本 2.0.0

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

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

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

You can’t perform that action at this time.