Skip to content

Instantly share code, notes, and snippets.

View pokutuna's full-sized avatar
👁️
👄👁👂

pokutuna pokutuna

👁️
👄👁👂
View GitHub Profile
@yukioc
yukioc / macrounit.c
Created November 16, 2009 14:04
C unit testing framework
#ifndef __macrounit_h__
#define __macrounit_h__
#define mu_prn_failed(file,line,expr) printf( "%s:%u: failed assertion `%s'\n",file,line,expr)
#define mu_prn_test(test,passed) printf( " Test: %s ... %s\n",test,(passed)?"passed":"FAILED")
#define mu_prn_suite(suite) printf( "Suite: %s\n",suite)
#define mu_assert(file,line,expr) do { ++mu_asserts; if (!(expr)) { ++mu_failures; mu_prn_failed(file,line,#expr); }} while (0)
#define MU_ASSERT(expr) mu_assert(__FILE__,__LINE__,expr)
#define mu_run_test(test) do { int f=mu_failures; ++mu_tests; test(); mu_prn_test(#test,(f==mu_failures)); } while (0)
@hitode909
hitode909 / zizo.el
Created December 19, 2010 09:23
zizo.el
(defun _zizo (begin end format)
(let (
(str (buffer-substring-no-properties begin end))
(rules '((" " "+") ("|" "%7C") ("\n" "|") ("?" "%3F") ("&" "%26")))
(rule nil))
(while rules
(setq rule (car rules))
(setq rules (cdr rules))
(let (
(a (car rule))
// 2 space の場合
// cond_c の前のindent, こんな感じで調節できる!!
if ((cond_a || cond_b ||
cond_c || cond_d) || cond_e) {
}
// 引数の場合とかでも
test(value1, value2,
value3, value4);
@rummelonp
rummelonp / oauth.yml
Created March 29, 2011 03:58
Userstreamからふぁぼられとかを監視とかしてGrowlとかするかもしれないRubyスクリプト
---
:consumer_key: consumer_key
:consumer_secret: consumer_secret
:oauth_token: oauth_token
:oauth_token_secret: oauth_token_secret
@tily
tily / erokimos.rb
Created August 8, 2011 13:31
なんでも性的にするやつ
NOUN_PREFIX = %w|こんもりした 恥じらうような たわわに実る 熟れた
爛れた 濡れた 黒光りする びっしりと密生した もりあがった
甘美な びしょ濡れの ぐしょ濡れの むっちりとした むっちりした 柔らかな
突起した 盛り上がった 嗚咽にも似た ピンク色の 薄紫色の
一糸纏わぬ 光沢のある 熱のこもった ヌメヌメとした ヌルヌルとした
|
VERB_PREFIX = %w|こんもりと 恥じらいながら 恥じらうように たわわに実らせて
ぐっしょりと びっしょりと たわわに 微かに 大胆にも もじもじと
|
#!/usr/bin/env ruby
#coding:utf-8
require 'mechanize'
alice = Mechanize.new
page = alice.get ARGV[0]
url = CGI.unescape page.root.xpath('//*[@id="flash-player-embed"]')[0]['flashvars'].split('&flv_url=').last.split('&').first
title = page.root.xpath('//td/strong')[0].inner_text.gsub(/\//, '/')+'.flv'
@lyricallogical
lyricallogical / gist:2470715
Created April 23, 2012 12:49
play2.0 の anorm の問題点をまとめてみる。間違いがあったらコメントしてもらえると助かります。問題がなければ本家に対してまとまった形で報告するつもりです。最終的な目標は anorm の改善です。

play2.0 の anorm の問題点まとめ

実装の詳細が公開されている

Useful 等の公開すべきでないものが公開されている。 型が書かれていない public なメンバも多く、API に対する意識が低い。

不要なものが公開されている

Pk, Id, NoAssigned 等は Magic のために導入された型だが、

@paulmillr
paulmillr / active.md
Last active July 15, 2024 10:55
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user => user.followers > 1000)
package DBIx::Lite::ResultSet::Role::Slave;
use strict;
use warnings;
use Role::Tiny;
around $_ => sub {
my ($ORIG, $self, @args) = @_;
local $self->{dbix_lite} = $self->{dbix_lite}->master;
return $self->$ORIG(@args);
} for qw(