Skip to content

Instantly share code, notes, and snippets.

@miyukki
miyukki / role.php
Created March 28, 2012 11:30
role.php is print text in current directory on display, and delete printed text.
<?php
while(true){
if ($handle = opendir('./')) {
/* ディレクトリをループする際の正しい方法です */
while (false !== ($file = readdir($handle))) {
if(endWith($file, '.txt')) {
printComment($file);
}
}
@miyukki
miyukki / LICENSE.txt
Created March 7, 2012 12:36 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@miyukki
miyukki / ezXMLParser.js
Created January 28, 2012 14:53
ezXMLParser is simple xml parser.
var ezXMLParser = {};
ezXMLParser.splitXML = function(XMLstr) {
var ret = new Array();
for(var count = 0; ezXMLParser.isExistStrictXML(XMLstr); count++){
//
var xml_end_char_index = XMLstr.indexOf('>');
var xml_start_char_index = XMLstr.indexOf('<');
@miyukki
miyukki / gist:1521405
Created December 26, 2011 15:28
Dosent Work!
<?php
var_dump(empty('test'));
function getPageTitle($url) {
$html = @file_get_contents($url);
$html = mb_convert_encoding($html, 'UTF-8', 'auto');
if ( preg_match( "/<title>(.*?)<\/title>/i", $html, $matches) ) {
return $matches[1];
} else {
return false;
}
}
"^ "
=~ (
("(").("~"^"."^"^"^(""=="")."").("^"
^"="^(""=="").""^")").("^"^".").("="
^"~"^(""=="")."").("("^(""=="^").""^
"."^"^").("("^(""=="").""^"^"^")").(
(" ^( "
== "
") .
"" ^
@miyukki
miyukki / NicoGadetHack
Created October 15, 2011 00:45
Saving ".vbs" file.
Option Explicit
On Error Resume Next
Dim objWshShell
Dim objFSO
Dim objFile
Set objWshShell = WScript.CreateObject("WScript.Shell")
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
@miyukki
miyukki / gist:1073268
Created July 9, 2011 03:31
number2alphabet in php
function number2alphabet($instr) {
$alphabettbl = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
$outstr = '';
$len = strlen($instr);
for ($i = 0; $i < $len; $i++) {
$char = substr($instr, $i, 1);
if(is_numeric($char)){
$outstr .= $alphabettbl[$char];
}else{
$outstr .= $char;