This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future = Npm.require('fibers/future'); | |
Meteor.methods({ | |
'future':function() { | |
console.log('future start:'+Date.now()); | |
var fut = new Future(); | |
Meteor.setTimeout(function() { | |
console.log('callback end:'+Date.now()); | |
fut.return('yahoo:'+Date.now()); | |
}, 1000); | |
console.log('future end:'+Date.now()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meteor.log = function() { | |
Meteor.call('log', arguments); | |
}; | |
Meteor.methods({ | |
"log": function(arg) { | |
console.log.apply(console, arg); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@vis = null | |
Meteor.startup -> | |
@vis = d3.select("svg") | |
.attr("width", 960) | |
.attr("height", 500) | |
@dragmove= (d,i)-> | |
console.log d.x, d.y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future = require('fibers/future'); | |
fiber = require('fibers'); | |
fiber(function() { /* Meteor는 요게 발라져 있음 */ | |
testFuture = function() { | |
var fut = new Future(); | |
setTimeout(function() { | |
fut.return(Date.now()); | |
}, 1000); | |
return fut.wait(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template name="basic"> | |
{{#with stuff}} | |
{{#S3 callback="savedURL"}} | |
<input type="file"> | |
{{/S3}} | |
{{/with}} | |
{{#each savedURL}} | |
<p>SAVED URL: {{url}}</p> | |
{{/each}} | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 계정 생성 | |
# Accounts.createUser({username:'kaka', password:'gogo'}); | |
# Accounts.createUser({username:'admin', password:'admin', profile: {role: 'ADMIN'}}); | |
Router.map -> | |
@route 'home', path: '/' | |
@route 'about' | |
@route 'admin' | |
@route 'noAuth' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
libs: [ | |
browser, | |
jquery, | |
underscore | |
], | |
loadEagerly: [ ], | |
dontLoad: [ .meteor ], | |
"plugins": { | |
meteor: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 <image_to_convert.png>" >&2 | |
exit 1 | |
fi | |
# imagemagick script | |
convert $1 -resize 57x57 iphone.png | |
convert $1 -resize 120x120 iphone_2x.png | |
convert $1 -resize 180x180 iphone_3x.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
srv=net.createServer(net.TCP, 15) | |
srv:listen(80, function(c) | |
c:on("receive", function(c, pl) | |
_, _, method, url, vars = string.find(pl, "([A-Z]+) /([^?]*)%??(.*) HTTP") | |
print(method..":"..url..":"..vars) | |
if file.open(url, "r")==nil then | |
file.open("index.html", "r") | |
end | |
c:send(file.read()) | |
file.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<title>WagleChatt</title> | |
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
</head> | |
<body> | |
<h3>와글챗에 어서오세요.</h3> | |
{{> hello}} | |
</body> |
OlderNewer