Skip to content

Instantly share code, notes, and snippets.

View boxp's full-sized avatar
👩‍💻
in reality

Keitaro Takeuchi boxp

👩‍💻
in reality
View GitHub Profile
@boxp
boxp / little-region.clj
Created May 17, 2014 20:01
Grimoireでリプ爆する為の設定
; リプ爆用関数
(defn little-region
"槍を持つたくさんの人形達が,標的に向かって突進して行く
(複数のアカウントから特定のツイート・ユーザーに対して
同じリプライを送る)
例1:(little-region @twitters 'marisa' 'hello')
全てのアカウントから@marisaに向けてhelloと呟く
例2:(little-region (-> @twitters (dissoc :syanhai1))
@boxp
boxp / cons_cell.c
Created May 19, 2014 14:18
C言語でコンスセルとその他諸々
#include<stdio.h>
#include<stdlib.h>
typedef struct cell {
int car;
struct cell *cdr;
} _cell;
struct cell *cons(int car, struct cell *cdr) {
@boxp
boxp / queue.c
Created June 2, 2014 01:14
C言語でキュー
#include <stdio.h>
#define QUEUESIZE 3000
struct Queue {
int buffer[QUEUESIZE];
int length;
};
int enqueue(struct Queue *queue, int data) {
@boxp
boxp / stack.c
Created June 2, 2014 01:23
C言語でスタック
#include <stdio.h>
#define STACKSIZE 3000
struct Stack {
int buffer[STACKSIZE];
int length;
};
int push(struct Stack *stack, int data) {
@boxp
boxp / bulletML_test.js
Created June 23, 2014 08:13
動かないゴミコード
enchant();
/* global vars */
const WIDTH = 320;
const HEIGHT = 480;
/* initial function */
window.onload = function () {
var game = new Game(WIDTH, HEIGHT);
@boxp
boxp / yo.clj
Last active August 29, 2015 14:03
Yo for Grimoire
(do
(import '(javafx.scene.media AudioClip))
(let [yo (AudioClip. "http://archbox.dip.jp/res/Yo.mp3")]
(reify Plugin
(get-name [this] "Yo")
(on-status [this status]
(if (re-find #"yo|Yo|YO" (. status getText))
(. yo play)))
(on-reply [this status] nil)
@boxp
boxp / bell.ruby
Created August 23, 2014 13:46
とりあえず
n=1;
a=["", ""];
$_.chomp.chars{|c|n.abs==1&&(n*=c.to_i+1)||(s=n<=>0)&&a[1<=>s]<<c&&(n-=s)&&n!=s||(n*=-1)&&n>0&&(p(a[1].to_f/a[0].to_f);a=["",""])}
@boxp
boxp / update-name.clj
Created September 12, 2014 06:15
update_name
(defn update-name
[status]
(let [n (.indexOf @tweets status)
new-name (-> (re-seq #"(.*)\(@If_I_were_boxp\)" (. status getText))
first
second)]
(if new-name
(do
(update-profile :tw twitter :new-name new-name)
(reply n (str new-name "に改名しました"))))
@boxp
boxp / hello.clj
Created December 26, 2014 23:25
hello
(reify Plugin
(get-name [this] "hello")
(on-status [this status]
(if (= (.. status getUser getScreenName) "delihiros")
(println "hello, hello!")))
(on-rt [this status])
(on-unrt [this status])
(on-fav [this source target status])
(on-unfav [this source target status])
(on-del [this status])
@boxp
boxp / fibonacci.scala
Last active December 10, 2015 05:18
This code is test for scala.
object fibonacci {
def main(args: Array[String]) {
var fibonacci = List(1,1)
while(fibonacci.length < args(0).toInt) {
fibonacci = fibonacci :+ fibonacci.takeRight(2).sum
}
println(fibonacci.apply(args(0).toInt - 1))