Skip to content

Instantly share code, notes, and snippets.

View rummelonp's full-sized avatar
🐈‍⬛
ニャーン

Kazuya Takeshima rummelonp

🐈‍⬛
ニャーン
View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
import codecs
import numpy as np
import MeCab
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import KMeans, MiniBatchKMeans
class Nyan
def behave_method(target, source)
(class << self; self end).module_exec do
alias_method "#{target}_original", target unless method_defined? "#{target}_original"
alias_method "#{source}_original", source unless method_defined? "#{source}_original"
alias_method target, "#{source}_original"
end
end
def with_behaving_method(a, b)
@Shinpeim
Shinpeim / 00.md
Last active October 31, 2024 05:59
Scala 入学式の資料

Better Java としての Scala

Hello World

  • src/main/scala/Main.scala
object Main {
  def main(args: Array[String]): Unit = {
    println("hello scala!")
@nobuoka
nobuoka / java-for-android-app.markdown
Last active September 28, 2024 01:59
Android アプリ開発勉強会のために書いた Java の入門文書

Android アプリ開発のための Java 入門

MEMO

  • declaration は 「宣言」 と訳しているが、「定義」 の方が適しているような気がしなくもない。
  • 「インスタンス」 と 「オブジェクト」 という言葉を使うことがあるが、本文書中ではどちらも同じ意味で使用している。
  • String オブジェクト」 という表現は、「String クラスのインスタンス」 を意味している。 (Java に限らず一般的な表現だと思う。)

はじめに

@voluntas
voluntas / shiguredo_env.rst
Last active December 2, 2024 00:23
時雨堂を支える環境

時雨堂を支える環境

日時:2024-12-02
作:時雨堂
バージョン:2024.3
url:https://shiguredo.jp/

2024-12 時点で従業員は全員フルリモート勤務中

花火~ 最高な俺たちと糞コードの海

written by mizchi at 小物エンジニアの会.

最高の夏の花火について 花火

自己紹介

@clicube
clicube / 0_icon_to_140.md
Last active February 27, 2024 01:05
アイコンを140文字にする話

アイコンを140文字にする話

なに?

この前ドット絵のアイコン書いたんですよ、こんなの。

@kyubing

結構うまくできたかなって満足してます。

@clicube
clicube / compress.rb
Last active December 19, 2015 22:59
binary file to ruby script file
# usage: ruby compress.rb icon.gif > myicon.rb
bit = 15
data = File.open(ARGV[0]){|f| f.read }
encoded_data = nil
offset = 0
bit_str = data.unpack("B*")[0]
(0x0000..0xffff).each do |i|
#footer {
left: auto;
bottom: 0px;
right: 0;
width: 500px;
height: 100%;
}
#info_playlist_frame_left {
height: 100%;
var Color = function() {
if (arguments.length == 1)
[this.r, this.g, this.b] = Color.parse(arguments[0]);
else if (arguments.length == 3)
[this.r, this.g, this.b] = arguments;
else
throw 'invalid number of arguments, takes one or three arguments';
};
Color.parse = function(color) {