This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 | |
| # カレントディレクトリ配下のファイル中に含まれる GUID を置換するスクリプト | |
| require 'rubygems' | |
| require 'uuidtools' | |
| # 置換対象外の GUID とその理由(必要に応じて追加) | |
| # GUID は UUIDTools::UUID#to_s の記法にあわせて、すべて小文字で記載すること | |
| guid_shouldnot_replace = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ImageGrab | |
| import itertools | |
| import time | |
| while True: | |
| im = ImageGrab.grab() | |
| data = im.getdata() | |
| print max([len(list(g)) for k, g in itertools.groupby(data) if k == (255, 0, 0)] or [0]), | |
| print max([len(list(g)) for k, g in itertools.groupby(data) if k == (0, 255, 0)] or [0]) | |
| time.sleep(0.5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| require 'yaml' | |
| require 'pp' | |
| # Object の拡張 | |
| class Object | |
| # [ xxx ].pack を xxx.pack と書けるようにする | |
| def pack(*args) | |
| [ self ].pack *args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| setlocal enabledelayedexpansion | |
| set LINE=1 | |
| for /f "tokens=1*" %%I in (A-small.in) do ( | |
| if "%%J" neq "" ( | |
| rem echo !LINE! %%I %%J | |
| set /a STATE="(1 << (%%I - 1)) & %%J" | |
| if !STATE! == 0 ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Redmine | |
| module WikiFormatting | |
| module Textile | |
| class Formatter < RedCloth3 | |
| def initialize_with_enabling_styles(*args) | |
| initialize_without_enabling_styles(*args) | |
| self.filter_styles = false | |
| end | |
| alias_method_chain :initialize, :enabling_styles | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| # 外部から送られたファイルをそれらしく SVN に取り込むスクリプト | |
| # | |
| # Windows での使用例 | |
| # set EDITOR=C:/sakura/sakura.exe | |
| # ruby fetch_third_party_file.rb 201104027 current | |
| # OS の判定処理 | |
| def windows? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/Contributed/Qt/Makefile.qt4 b/Contributed/Qt/Makefile.qt4 | |
| index db561cd..e7d3d56 100644 | |
| --- a/Contributed/Qt/Makefile.qt4 | |
| +++ b/Contributed/Qt/Makefile.qt4 | |
| @@ -432,7 +432,7 @@ ${ZLIB_TARBALL}: | |
| wget http://www.zlib.net/${ZLIB_TARBALL} | |
| ${LIBICONV_TARBALL}: | |
| - wget http://www.gimp.org/~tml/gimp/win32/${LIBICONV_TARBALL} | |
| + wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/${LIBICONV_TARBALL} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @if(0)==(0) ECHO OFF | |
| CScript.exe //NoLogo //E:JScript "%~f0" %* | |
| pause | |
| GOTO :EOF | |
| @end | |
| var fso = new ActiveXObject('Scripting.FileSystemObject'); | |
| if (!fso.FolderExists('dist')) { | |
| fso.CreateFolder('dist'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff -ur gvedit/UPreProcess.cpp gvedit_mine/UPreProcess.cpp | |
| --- gvedit/UPreProcess.cpp Tue Feb 02 04:19:53 2010 | |
| +++ gvedit_mine/UPreProcess.cpp Wed Mar 02 01:57:59 2011 | |
| @@ -46,7 +46,7 @@ | |
| void __fastcall TfrmPre::Button3Click(TObject *Sender) | |
| { | |
| TIniFile *ini; | |
| - AnsiString FileName=ExtractFilePath( Application->ExeName)+"Settings.ini" ; | |
| + AnsiString FileName = getIniFile(); | |
| if(FileExists(FileName)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // D で作る Win32 DLL - プログラミング言語 D 2.0 | |
| // http://www.kmonos.net/alang/d/2.0/dll.html | |
| // から拝借。 | |
| // | |
| // -w オプションつきでコンパイルすると以下のエラーになったので default: を追加しています | |
| // warning - dll.d(8): Error: switch statement has no default | |
| // warning - dll.d(8): Error: statement is not reachable | |
| import core.runtime; | |
| import std.c.windows.windows; |