Skip to content

Instantly share code, notes, and snippets.

View Mossuru777's full-sized avatar

Mossuru777 Mossuru777

View GitHub Profile
#!/bin/bash
# https://gist.github.com/ihsoy-s/5292735 を参考にしました
channel="$1"
#
# parameter setting
#
pid=$$
#!/bin/bash
red=31
green=32
lightblue=36
function cecho {
color=$1
shift
echo -e "\033[${color}m$@\033[m"
@echo off
for /f "usebackq tokens=*" %%i in (`cygpath '%CD%'`) do set RESULT=%%i
C:
chdir C:\cygwin64\bin
bash -l -c "cd '%RESULT%';bash -"
@Mossuru777
Mossuru777 / ruby-2.1.6-test-fix-on-cygwin.patch
Created May 7, 2015 04:33
Ruby 2.1.6 Test Fix Patch for Cygwin Build
diff --git a/ext/-test-/printf/printf.c b/ext/-test-/printf/printf.c
index d913fe5..1ebe804 100644
--- a/ext/-test-/printf/printf.c
+++ b/ext/-test-/printf/printf.c
@@ -28,7 +28,7 @@ printf_test_q(VALUE self, VALUE obj)
}
static char *
-utoa(char *p, char *e, unsigned int x)
+my_utoa(char *p, char *e, unsigned int x)
@Mossuru777
Mossuru777 / numstr_cmp_bench.pl
Created June 18, 2015 12:23
Number(String) Compare
use Benchmark qw/cmpthese/;
my @input = ("1", "0");
cmpthese(0, {
'String' => sub { foreach (@data) { $_ eq "0" || $_ eq "1" } },
'Number' => sub { foreach (@data) { $_ == 0 || $_ == 1 } },
'Regex' => sub { foreach (@data) { $_ =~ /^[01]$/ } }
});
@Mossuru777
Mossuru777 / repair_timemachine_backup.md
Last active April 10, 2019 02:55
Repair TimeMachine Backup

Repair TimeMachine Backup

  1. Mount TimeMachine volume from Finder.

  2. Unlock Target Machine's Backup sparsebundle.

    sudo chflags -R nouchg /Volumes/{TimeMachine Volume Name}/{Target Machine's Name}.sparsebundle
    
@Mossuru777
Mossuru777 / imagemagick-plenv-install.md
Last active January 18, 2016 16:18
plenv環境でのImage::Magickインストール

Installing ImageMagick (Image::Magick) on a custom Perl installed via plenv
https://darkpan.com/files/plenv-imagemagick.txtより転載

  • plenv
    git clone git://github.com/tokuhirom/plenv.git ~/.plenv
    echo 'export PATH="$HOME/.plenv/bin:$PATH"' >> ~/.bash_profile
    echo 'eval "$(plenv init -)"' >> ~/.bash_profile
    source ~/.bash_profile
@Mossuru777
Mossuru777 / goodbye-promo.js
Last active May 9, 2016 16:44
バイバイプロモ
(function() {
function goodbyePromo() {
$('div.promoted-tweet').children('div.content').children('div.context').children('button.js-action-dismiss').click();
};
goodbyePromo();
var mo = new MutationObserver(goodbyePromo);
mo.observe($('div.stream-container').get(0), {'attributes':true, 'childList': true, 'subtree': true});
})();
@Mossuru777
Mossuru777 / preg_quote.js
Last active May 12, 2016 16:54
PHP's preg_quote in JavaScript (http://locutus.io/php/pcre/preg_quote/)
module.exports = function preg_quote (str, delimiter) { // eslint-disable-line camelcase
// discuss at: http://locutus.io/php/preg_quote/
// original by: booeyOH
// improved by: Ates Goral (http://magnetiq.com)
// improved by: Kevin van Zonneveld (http://kvz.io)
// improved by: Brett Zamir (http://brett-zamir.me)
// bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)
// example 1: preg_quote("$40")
// returns 1: '\\$40'
// example 2: preg_quote("*RRRING* Hello?")
" ファイルエンコーディング
set fileencodings=utf-8,cp932
" 編集中のファイルが変更されたら自動で読み直す
set autoread
" 行番号を表示
set number
" 現在の行を強調表示