Skip to content

Instantly share code, notes, and snippets.


Yoshinari Takaoka mumumu

View GitHub Profile
mumumu / gist:80349
Created Mar 17, 2009
C++ Hello World
View gist:80349
#include <iostream>
int main(int argc, char *argv[])
std::cout << "Hello World!!" << std::endl;
return 0;
View thread safe, but non-portable randamize function.
#include <math.h>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
// returns random number from zero to max.
// to compile this, run the following command.
// $ gcc -Wall -lm -lrt filename
View gist:171646
#include <stdio.h>
int main(int argc, char *argv[])
int a = 0;
// displays true!
if (a == 0) printf("true!\n");
else {
View modified-pointer-error.c
#include <stdio.h>
#include <stdlib.h>
static const int BUFSIZE = 256;
int main(int argc, char *argv[])
char *buffer = (char *)malloc(BUFSIZE);
if (buffer == NULL) {
fprintf(stderr, "out of memory");
View gist:266996
use strict;
use warnings;
use Net::Twitter;
use Encode;
binmode(STDOUT, ":utf8");
my $ng_word_regex = decode("utf-8", "XXXXX");
View twitter_stats_blocker.user.js
// ==UserScript==
// @name Twitter Stats Blocker
// @varsion 1.00
// @description following, follower, listed の数を非表示にするスクリプト。follow, remove を気にしたくない人にお勧め(かもしれない)
// @include*
// @namespace
// @author mumumuorg
// ==/UserScript==
View My_Session_SaveHandler_DbTable.php
class My_Session_SaveHandler_DbTable extends Zend_Session_SaveHandler_DbTable
* Read session data
* @param string $id
* @return string
# marriage paper submit date calculation program.
# usage: perl [year] [month] [date]
use strict;
use warnings;
View aoi_face_rec.html
<script type="text/javascript"
<script type="text/javascript" src="./excanvas.js"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
var canvas = document.getElementById('aoi_miyazaki_canvas');
View gist:650944
javascript:(function(d,r,o,l,x,y,u,a,b,n,m,s,i){n=d.createElement("pre");n.setAttribute("style","z-index:100;font-weight:bold;position:absolute;left:0px;top:0px;background:black;color:white"); var img =d.createElement("img"); img.setAttribute("src", ""); img.setAttribute("style", "z-index:150;font-weight:bold;position:absolute;left:0px;top:150px;"); d.body.appendChild(img); s=new Array(o+1).join(" ");for(i=0;i<l;i++)n.appendChild(m=r[i]=d.createTextNode(s)),n.appendChild(d.createTextNode("\n"));function p(x,y,c,_){with(r[y])nodeValue=nodeValue.substring(0,x)+c+nodeValue.substring(x+c.length)}a=x,b=y,setInterval(function(i){p(x,y," ");for(i=u.length;--i>=0;)with(u[i])p(x--,y," "),x>0?p(x,y,"-"):u.splice(i,1);x=a,y=b,p(x,y,"<?php");},50);d.onkeydown=function(e){switch(e.keyCode){case 90:a=x>0?x-1:x;break;case 83:b=y>0?y-1:0;break;case 67:a=x<o-5?x+1:x;break;case 88:b=y<l-1?