Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META name="GENERATOR" content="IBM WebSphere Homepage Builder Version 6.0.2.1 for Windows">
<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<META http-equiv="Content-Style-Type" content="text/css">
<TITLE></TITLE>
</HEAD>
<BODY>
<DIV id="cv"></DIV>
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Diagnostics;
namespace StandByPreventor
{
class Program
{
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
DirPath = ARGV[0]
puts DirPath
Dir::chdir(DirPath)
dirs = Dir::glob("*/")
mp3files = Dir::glob("*.mp3¥0*.wma")
template<typename Out,typename In>
Out log2(In x)
{
for(Out i = 0; i<sizeof(In)*8; ++i){
x = x >> 1;
if(!x)
return i;
}
}
#!/bin/sh
mv $1 $1.tmp
nkf --ic=utf8 --oc=sjis $1.tmp > $1
platex $1
mv $1.tmp $1
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
#include <errno.h>
struct getch_flag
{
char line:1;
char echo:1;
#!/bin/sh
if [ -d ~/.Trash ]; then
:
else
mkdir ~/.Trash
fi
for f in "$@"
do
basename=`basename $f`
@aont
aont / macport_analyse.sh
Created March 10, 2011 15:43
macport manipulate
#!/bin/sh
port installed \
| sed -e "1d" \
| grep active | sed -e "s/(active)//" \
| grep universal | sed -e "s/\+universal//" \
| sed -e "s/@[^\+]*//" \
| while read LINE; do
port clean $LINE
javascript:window.open(location.href,'_blank','location=no,resizable=yes,scrollbars=yes,status=no');undefined;
@aont
aont / num_op.js
Created March 12, 2011 10:04
URL number operate
function to(num)
{
location.href = location.href.replace(/(\d+)([^0-9]*$)/, num.toString() + "$2");
}
function diff(d)
{
if (location.href.match(/(\d+)([^0-9]*$)/))
{
num = parseInt(RegExp.$1, 10) + d;
location.href = location.href.replace(/(\d+)([^0-9]*$)/, num.toString() + "$2");