Skip to content

Instantly share code, notes, and snippets.

@andyyou
andyyou / fix_homebrew.rb
Created September 24, 2015 01:11 — forked from rpavlik/fix_homebrew.rb
Fix permissions on /usr/local for Homebrew
#!/usr/bin/ruby
#
# This script fixes /usr/local only.
#
# 6th January 2010:
# Modified the script to just fix, rather than install. - rpavlik
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
@andyyou
andyyou / react-coverflow.example.js
Last active September 13, 2016 09:09
React Coverflow example
var React = require('react');
var ReactDOM = require('react-dom');
var Coverflow = require('react-coverflow');
var fn = function () {
/* do you want */
}
ReactDOM.render(
<Coverflow
@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');
@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 / index.jade
Created September 17, 2014 04:18
A Pen by AndyYou.
#example
@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" />
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
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
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
<!doctype html>
<html>
<head>
<meta charset='utf-8' />
<title>Helo, Backbone View</title>
<style>
#container {
padding:20px;
border:1px solid #333;
width:400px; }