Skip to content

Instantly share code, notes, and snippets.

View moyhig's full-sized avatar

Manabu Higashida moyhig

View GitHub Profile
@moyhig
moyhig / test.md
Created October 31, 2012 06:42
test

テスト

#include <stdio.h>

main ()
{
  printf("hello world\n");
}
main()
{
printf("hello world\n");
}
@moyhig
moyhig / gist:3992269
Created November 1, 2012 07:10
Jaxer Shell Header
Jaxer.Includer.load('http://code.jquery.com/jquery-1.8.2.min.js');
Jaxer.Includer.load('https://jquery-json.googlecode.com/files/jquery.json-2.3.min.js');
@moyhig
moyhig / gist:3992583
Created November 1, 2012 09:01
2012/11/01
<style type="text/css">
.gist-meta {
display: none !important;
visibility: hidden !important;
}
</style>
<link rel="stylesheet" href="https://gist.github.com/stylesheets/gist/embed.css" />
<div class="gist gist-syntax">
@moyhig
moyhig / gist:3999602
Created November 2, 2012 09:00
TypeScript Compiler, on-the-fly
Jaxer.Includer.load('http://requirejs.org/docs/release/2.1.1/minified/require.js');
Jaxer.Includer.load('http://www.typescriptlang.org//Script/vs/languages/typescript/typescript.js');
var ts = TypeScript;
var outfile = {
source: '',
Write: function(s) { this.source += s; },
WriteLine: function(s) { this.source += s + "\r\n"; },
Close: function() {},
};
var outerr = {
@moyhig
moyhig / jaxer_markdown.js
Created November 5, 2012 13:15
2012/11/05
function jaxer_markdown (url) {
var text = Jaxer.Web.get(url, { as: 'text' });
var data = { text: text, mode: "gfm" };
var html = Jaxer.Web.post("https://api.github.com/markdown", JSON.encode(data));
return(html);
}
jaxer_markdown.proxy = true;
@moyhig
moyhig / node_jquery.js
Created November 6, 2012 05:44
2012/11/06
var sys = require('sys'),
jsdom = require('jsdom');
var document = jsdom.jsdom("<html><head></head><body></body></html>");
var window = document.createWindow();
jsdom.jQueryify(window, "http://code.jquery.com/jquery-1.8.2.js", function(window,$) {
$.getJSON("https://api.github.com/gists/3985489?callback=?",
function(data) {
sys.print(JSON.stringify(data, null, 4) + "\n");
@moyhig
moyhig / gist:4023593
Created November 6, 2012 09:03
2012/11/06: Jaxer vs. jQuery.ajax
<script runat="server">
jQuery(function($){
$.getJSON("https://api.github.com/gists/3985489?callback=?",
function(data) {
$('div#x1').append(JSON.stringify(data, null, 4));
$('div#x2').append(data['data']['files']['test.md']['content']);
});
});
</script>
<pre>
@moyhig
moyhig / jsdom-wiki.js
Created November 8, 2012 13:05
2012/11/08
var jsdom = require("jsdom").jsdom;
var document = jsdom("<html><head></head><body></body></html>");
var window = document.createWindow();
var url = "http://higashida.net/mediawiki/api.php?action=parse&page=Main_Page&format=json&callback=?";
//var url = "http://en.wikipedia.org/w/api.php?action=parse&page=Markdown&format=json&callback=?";
//var url = "https://api.github.com/gists/3985489?callback=?";
jsdom.jQueryify(window, "http://code.jquery.com/jquery-1.8.1.js", function(window,$) {
$.ajaxSetup({"error":function(XMLHttpRequest,textStatus, errorThrown) {
@moyhig
moyhig / gist:4059307
Created November 12, 2012 13:08
2012/11/12
<script type="text/javascript">
AJS.toInit(function ($) {
$.getJSON("https://api.github.com/gists/3985489?callback=?",
function(data) {
$('div#x1').append(JSON.stringify(data, null, 4));
$('div#x2').append(data['data']['files']['test.md']['content']);
});
});
</script>
<pre>