Skip to content

Instantly share code, notes, and snippets.

View billyct's full-sized avatar
🍎
一只想变成橘子的苹果

billyct billyct

🍎
一只想变成橘子的苹果
View GitHub Profile
'use strict';
var arr = [ 1, 2, 3, 4, 5 ];
var fnArr = [];
// Wrong 1
for (var i = 0; i < arr.length; i++) {
fnArr[i] = function() {
return arr[i];
};
/*
*usage: <textarea ui:pagedown-bootstrap ng:model="box.content"></textarea>
*/
myApp.directive('uiPagedownBootstrap', function() {
var nextId = 0;
return {
require: 'ngModel',
replace:true,
template:'<div class="pagedown-bootstrap-editor"></div>',
app.use(express.methodOverride());
// ## CORS middleware
//
// see: http://stackoverflow.com/questions/7067966/how-to-allow-cors-in-express-nodejs
var allowCrossDomain = function(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization');
<head>
<title>meteor_servercall</title>
</head>
<body>
{{> simple}}
{{> passData}}
</body>
<template name="simple">
ion $ cd ..
ion $ rm -Rf my-test-project/
ion $ mrt uninstall --system
Deleting ~/.meteorite. Note that previously installed projects will no longer work...
ion $ mrt create my-test-project
Fetching Meteor (branch: master)...
Downloading Meteor development bundle...
######################################################################## 100.0%
my-test-project: created.
# This little gist shows how to easily internationalize your application using the meteor-just-i18n package.
# Package repository: https://github.com/subhog/meteor-just-i18n/
# 1. Installing the package with Meteorite.
$ mrt add just-i18n
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"