Skip to content

Instantly share code, notes, and snippets.

@andyyou
andyyou / backbone sample
Created May 10, 2013 06:51
backbone sample
<!doctype html>
<html>
<head>
<title>Hello Backbone</title>
</head>
<body>
<button id="check">Check</button>
<ul id="list"></ul>
<!doctype html>
<html>
<head>
<title>Hello Backbone Model</title>
</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<script src="http://documentcloud.github.com/backbone/backbone-min.js"></script>
<!doctype html>
<html>
<head>
<meta charset='utf-8' />
<title>Helo, Backbone View</title>
<style>
#container {
padding:20px;
border:1px solid #333;
width:400px; }
1. 安裝完成 CentOS 之後設定 VMWare 網路連線為 Bridge
2. vi /etc/sysconfig/network-scripts/ifcfg-eth0
3. 編輯內容如下
DEVICE=eth0
TYPE=Ethernet
HWADDR=00:0C:29:1B:3C:33
UUID=d1f10f9c-9393-45db-950d-5d8d49c9bf88
ONBOOT=yes
BOOTPROTO=static
NM_CONTROLLED=yes
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace CoolProject
{
public class NewViewEngine : RazorViewEngine
public HttpResponseMessage PutGame(int id, Game game)
{
if (ModelState.IsValid && id == game.Id)
{
var g = db.Games.Find(id);
g.InjectFrom(game);
g.ModifyOn = DateTime.Now;
game.InsertOn = DateTime.Now;
try
@andyyou
andyyou / web.config
Created August 1, 2013 02:14
Run woff and some resource on azure
<?xml version="1.0"?>
<!-- Web.Config Configuration File -->
<configuration>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<staticContent>
<remove fileExtension=".svg" />
<remove fileExtension=".eot" />
<remove fileExtension=".woff" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
@andyyou
andyyou / index.jade
Created September 17, 2014 04:18
A Pen by AndyYou.
#example
@andyyou
andyyou / gulpfile.js
Created September 17, 2014 12:08
The question?
var gulp = require("gulp"),
connect = require("gulp-connect"),
less = require("gulp-less"),
react = require("gulp-react"),
watch = require("gulp-watch"),
jade = require("gulp-jade"),
clean = require("gulp-clean");
@andyyou
andyyou / codepen-with-react.js
Last active September 10, 2016 16:26
codepen-with-react.js
(function() {
function runScripts() {
var bodyScripts = 'body script:not([src])';
var count = 0;
Array.prototype.forEach.call(document.querySelectorAll(bodyScripts), function setJSXType(element) {
if (count++ === 0) {
var res = ["http://fb.me/react-with-addons-0.11.2.js", "http://fb.me/JSXTransformer-0.11.2.js"];
for (r in res) {
var tag = document.createElement('script');