Skip to content

Instantly share code, notes, and snippets.

@p01
p01 / LICENSE.txt
Last active May 23, 2024 13:46 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@ukyo
ukyo / autoreference_dbref_patch.py
Created September 25, 2011 05:05
pymongo AutoReference DBRef patch
#coding: utf8
"""pymongoのAutoReferenceにパッチ当てるやつ
リスト内のDBRef全部にクエリを発行せずに{$in: [1,2,...,n]}する。
Example:
>>> from pymongo.son_manipulator import AutoReference, NamespaceInjector
>>> import autoreference_dbref_patch
"""
@ksauzz
ksauzz / fluent.conf
Created September 29, 2011 16:54
fluent input plugin sample
<source>
type xxxx
host 192.168.x.x
port 1999
</source>
@kokudori
kokudori / gist:1366106
Created November 15, 2011 04:10
Rubyでニコ生のコメントを取得
# -*- encoding: utf-8 -*-
require 'net/http'
require 'rubygems'
require 'nokogiri'
class Comment
class << self
attr_accessor :cookie
end
#下の値はブラウザのクッキーから取得してください
@halcat0x15a
halcat0x15a / gist:2650915
Created May 10, 2012 03:47
Scalaz === Scala
// Id
"0" ?? "1" assert_=== ("0" match { case null => "1"; case s => s })
0 |> (1 +) assert_=== (1 +)(0)
// 0.left[String] assert_=== Left[Int, String](0)
// 0.right[String] assert_=== Right[String, Int](0)
@rummelonp
rummelonp / faraday.md
Last active May 20, 2022 12:23
Ruby の HTTP クライアントライブラリ Faraday が便利そう

Ruby の HTTP クライアントライブラリ Faraday が便利そう

Ruby の HTTP クライアントライブラリ Faraday が便利そう

API ラッパの開発には [RestClient gem][rest_client_gem] だとか
OAuth の必要なものは [Net/HTTP][net_http] + [OAuth gem][oauth_gem] を使ってた

[Twitter gem][twitter_gem] や [Instagram gem][instagram_gem] など API ライブラリのソースを読んでみると
[Faraday gem][faraday_gem] というものがよく使われてた

@melborne
melborne / classes.txt
Created July 16, 2012 10:03
Ruby Methods Analysis
ARGF
ArgumentError
Array
BasicObject
Bignum
Binding
Class
Comparable
Complex
Data
@krrrr38
krrrr38 / DataImport.scala
Created March 15, 2013 02:43
mallet形式の日本語名詞データ生成 with Mecab(wiki+hatena辞書)
object DataImport extends App {
val inputDirJa = "../data/sample-data/web/ja"
val stopWordJa = "../data/stoplists/jp.txt"
val outputFileJa = "data/import_test_ja.mallet"
val importer = new ImportJapaneseNoun(new File(stopWordJa))
val instances = importer.readDirectory(new File(inputDirJa))
instances.save(new File(outputFileJa))
}
@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!")
@azymnis
azymnis / ItemSimilarity.scala
Created December 13, 2013 05:17
Approximate item similarity using LSH in Scalding.
import com.twitter.scalding._
import com.twitter.algebird.{ MinHasher, MinHasher32, MinHashSignature }
/**
* Computes similar items (with a string itemId), based on approximate
* Jaccard similarity, using LSH.
*
* Assumes an input data TSV file of the following format:
*
* itemId userId