This file contains hidden or 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
console.log("timer with node.js"); | |
var now = new Date() | |
console.log(now); | |
var alarm = function(name){ | |
var now = new Date() | |
console.log(now); | |
console.log(name); | |
console.log("alarm!, alarm!, alarm!, alarm!"); |
This file contains hidden or 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
<html> | |
<head> | |
<style> | |
/* Base styles*/ | |
* { | |
margin: 0; | |
padding: 0; | |
} | |
body { |
This file contains hidden or 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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | |
<title>MessageBox</title> | |
<link rel="stylesheet" type="text/css" href="ext-all.css" /> | |
<script type="text/javascript" src="ext-base.js"></script> | |
<script type="text/javascript" src="ext-all.js"></script> | |
<style type="text/css"> | |
#msg-div { | |
position:absolute; |
This file contains hidden or 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
var d = new Date(); | |
var curr_hour = d.getHours(); | |
var curr_min = d.getMinutes(); | |
var curr_sec = d.getSeconds(); | |
now = curr_hour.toString() + ":" + curr_min.toString() + ":" + curr_sec.toString(); | |
notice.msg("time",now); |
This file contains hidden or 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
<html> | |
<head> | |
</head> | |
<body> | |
<pre> | |
localStorage: | |
used for long-term storage. This data persists after the window is closed and is shared across all browser windows. | |
localStorage.setItem(key,value); | |
localStorage.getItem(key); | |
localStorage.clear(); |
This file contains hidden or 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
var faye = require('./lib/faye-node'); | |
var http = require('http'); | |
var client = new faye.Client('http://localhost:9000/faye'); | |
client.publish("/a","asdasdasdasd"); |
This file contains hidden or 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
$this_version = '2010.12.28.001' | |
$resource_url = 'http://169.254.169.254/latest/meta-data/' | |
$instance_info_hash = Hash.new | |
def vmInfo() | |
def a(address) | |
url = URI.parse(address) | |
req = Net::HTTP::Get.new(url.path) | |
res = Net::HTTP.start(url.host, url.port) { |http| http.request(req) } | |
res.body.split().map { |i| lambda{ if i[-1,1] != "/" then $instance_info_hash[(address+i)[40..-1]] = "" else lambda{a(address+i)}.call end}.call} |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'net/http' | |
$this_version = '2011.01.04.001' | |
$resource_url = 'http://169.254.169.254/latest/meta-data/' | |
$instance_info_hash = Hash.new | |
def vmInfo() |
This file contains hidden or 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 | |
# | |
# This script will be executed *after* all the other init scripts. | |
# You can put your own initialization stuff in here if you don't | |
# want to do the full Sys V style init stuff. | |
# load pci hotplug for dynamic disk attach in KVM (for EBS) | |
depmod -a | |
modprobe acpiphp |
This file contains hidden or 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
def reportToInstanceService(arg) | |
instance_service_url = JSON.parse(arg)['atmosphere']['instance_service_url'] | |
token = JSON.parse(arg)['atmosphere']['token'] | |
userid = JSON.parse(arg)['atmosphere']['userid'] | |
res = Net::HTTP.post_form(URI.parse(instance_service_url), {'token'=> token, 'userid'=>userid,'vminfo'=>$instance_info_json}) | |
end | |
def reportToInstanceServiceSSL(arg) | |
instance_service_url = JSON.parse(arg)['atmosphere']['instance_service_url'] | |
token = JSON.parse(arg)['atmosphere']['token'] |