Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Kazuhiro Homma kazuph

🏠
Working from home
View GitHub Profile
@korakot
korakot / record.py
Last active Oct 29, 2020
Record audio in Colab using getUserMedia({ audio: true })
View record.py
# all imports
from IPython.display import Javascript
from google.colab import output
from base64 import b64decode
from io import BytesIO
!pip -q install pydub
from pydub import AudioSegment
RECORD = """
const sleep = time => new Promise(resolve => setTimeout(resolve, time))
@hayajo
hayajo / 00.md
Last active Oct 29, 2020
TCP/IPとか運用とかsystemdとか #オンシャヘイシャ
@ChocolateMinht
ChocolateMinht / Alamofire.swift
Created Jan 7, 2015
Alamofire wrapped in a struct (iOS7 compatibility)
View Alamofire.swift
// Alamofire.swift
//
// Copyright (c) 2014 Alamofire (http://alamofire.org)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
View Makefile
OUT = ir-state.png ir-learn.png ir-send.png packer.png wifi-morse-setup.png
all: $(OUT)
.SUFFIXES: .png .gv .msc
.gv.png:
dot -Tpng $< -o $@
@ainame
ainame / AMEHTTPRequestTestCase.h
Last active Aug 29, 2015
非同期+HTTPリクエストをスタブしたいときに使うと便利なテストクラス
View AMEHTTPRequestTestCase.h
#import <XCTest/XCTest.h>
#import <TKRGuard.h>
#import <OHHTTPStubs.h>
@interface AMEHTTPRequestTestCase : XCTestCase
@property (nonatomic, strong) NSURLRequest *lastRequest;
- (void)stubAllRequestWithResponseFileName:(NSString *)responseFileName statuCode:(NSInteger)statusCode;
@hayajo
hayajo / downcase.ank
Last active Aug 29, 2015
ankoを使ってプラグイン機構っぽいのを実装してみた
View downcase.ank
filter.Add(func(s) {
return strings.ToLower(s)
}, 10)
@yoheia
yoheia / perl_oneliner_example
Last active Jan 24, 2020
Perlワンライナー&マルチライナー集
View perl_oneliner_example
Perl ワンライナーサンプル集
■概要
障害解析のためのログの調査、非互換対応でのソースコードの調査といった
テキスト処理で使った Perl ワンライナーのサンプル集です。
Perl ワンライナーは以下の点が良いと思います。
・Perl は Oracle Database (10g以降) に同梱されている。
 従って、Windows プラットフォームでも使える。
View noda.pl
my (@price,@day);
<STDIN> =~ /(\d+) (\d+)/;
$price[$_] = <STDIN> for (0..($1-1));
$day[$_] = <STDIN> for (0..($2-1));
@price = sort {$a <=> $b} @price;
for my $setprice (@day){
my @tmp = grep { $_ <= $setprice - $price[0] } @price;
my $check = 0;
@wsargent
wsargent / docker_cheat.md
Last active Oct 10, 2020
Docker cheat sheet
View docker_cheat.md
@syohex
syohex / fujiwara-aa.pl
Last active Dec 25, 2015
AA of fujiwara-san
View fujiwara-aa.pl
#!perl
use strict;
use warnings;
use Furl;
use Imager;
use Text::AAlib qw(:all);
my $url = 'https://1.gravatar.com/avatar/ca6281fff64797dc419b78f51f25c0a5?d=https%3A%2F%2Fidenticons.github.com%2F51beaebc231c8720d18d10b0008693dc.png&s=420';
my $ua = Furl->new;
You can’t perform that action at this time.