Skip to content

Instantly share code, notes, and snippets.

View iso2022jp's full-sized avatar
🌌
Working in the metaverse

USHITO Hiroyuki iso2022jp

🌌
Working in the metaverse
View GitHub Profile
@iso2022jp
iso2022jp / gemstrings.pl
Created February 12, 2014 14:48
CodeIQ q684 gemstrings.
#!/bin/perl
#---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
# $ perl gemstring.pl eagcdfbe 1 4 1 4 2 1 3
use v5.10;
use strict;
use integer;
# no Memoize; # :-)
@iso2022jp
iso2022jp / nudo.c
Created November 11, 2012 09:09
nudo.exe: Do as a normal user
#define STRICT
#define WIN32_LEAN_AND_MEAN
#define VC_EXTRALEAN
#include <windows.h>
#include <winsafer.h>
void Zero(void *dest, size_t count) {
char *p = (char *)dest;
@iso2022jp
iso2022jp / gist:4057845
Created November 12, 2012 06:41
VBA: Convert character encoding
Option Explicit
Public Sub ConvertEncoding(ByRef SourcePath As String, ByRef DestinationPath As String, ByRef SourceEncoding As String, ByRef DestinationEncoding As String)
Dim oWork As Object
With CreateObject("ADODB.Stream")
' load source
@iso2022jp
iso2022jp / bmp2gif.pl
Created November 12, 2012 06:53
Perl: Pure BMP to GIF converter
#!/usr/bin/perl
use strict;
use warnings;
use bmp_io;
sub compress_vcl_lzw ($$);
my $transparent = @ARGV ? $ARGV[0] : undef;
perl convert.pl < shufflers.txt > shufflers-for-mysql.txt
mysql -N test < solve.sql > result.txt
@iso2022jp
iso2022jp / dropbox-info.sh
Last active December 18, 2015 17:38
Queries information of associated dropbox account for Cacti.
#!/bin/bash
#
# Query Dropbox Account Information
#
# $referral
# $name
# $uid
# $country
@iso2022jp
iso2022jp / crossing.c
Last active December 22, 2015 03:09
CodeIQ q432 crossing
/* ********************************************************************** */
/*
矢印を逆転して見ると、隣接要素を交換しながらのソートになっている
交差回数は、隣接交換に必要な最小回数を表している。
隣接交換はどこから着手しても同じ結果になるし計算しやすいが
単純なバブルソートでは時間がかかるのでマージソートを使う。
*/
/* ********************************************************************** */
#!/bin/perl
#---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
=pod
=encoding UTF-8
=head1 213個の単語からパングラムを作ろう - 解答
=head2 提出要件
@iso2022jp
iso2022jp / $grep.js
Created July 22, 2017 06:27
何か探索するアレ
function $grep(o, v, p = '') {
$grep.known = []
return $grep.find(o, v, p)
}
$grep.match = function (e, v) {
return v instanceof RegExp ? typeof e !== 'object' && typeof e !== 'function' && v.test(String(e)) : e === v
}
$grep.pandora = function (key) {
@iso2022jp
iso2022jp / from_base64.sql
Created September 5, 2019 23:49
FROM_BASE64 custom function for old MySQL
DROP FUNCTION IF EXISTS FROM_BASE64;
DELIMITER ;;
CREATE FUNCTION FROM_BASE64 (base64 BLOB) RETURNS BLOB DETERMINISTIC SQL SECURITY INVOKER
BEGIN
DECLARE plain BLOB DEFAULT '';
DECLARE o INTEGER DEFAULT 0;