Skip to content

Instantly share code, notes, and snippets.

View xatier's full-sized avatar
🍰
吃點心

xatier xatier

🍰
吃點心
  • ド田舎
View GitHub Profile
>++++++++++>>>+>+[>>>+[-[<<<<<[+<<<<<]>>[[-]>[<<+>+>-]<[>+<-]<[>+<-[>+<-[>
+<-[>+<-[>+<-[>+<-[>+<-[>+<-[>+<-[>[-]>>>>+>+<<<<<<-[>+<-]]]]]]]]]]]>[<+>-
]+>>>>>]<<<<<[<<<<<]>>>>>>>[>>>>>]++[-<<<<<]>>>>>>-]+>>>>>]<[>++<-]<<<<[<[
>+<-]<<<<]>>[->[-]++++++[<++++++++>-]>>>>]<<<<<[<[>+>+<<-]>.<<<<<]>.>>>>]
@xatier
xatier / int.c
Last active December 14, 2015 07:59
a very simple brainfuck intepreter in C
#include <stdio.h>
#include <string.h>
void eval (char *input) {
char mem_cell[5000], c;
memset(mem_cell, 0, sizeof(mem_cell));
int in, in_ptr, loop;
char *ptr = mem_cell;
@xatier
xatier / bf.py
Created February 28, 2013 06:12
#!/usr/bin/python
import sys
def eval_(input_):
mem_cell = [0] * 5000
c = ''
ptr = in_ptr = loop = 0
while in_ptr < len(input_):
R1 Yuren Ju: Unit testing, CI and Firefox OS
R2 fr3@k: Asynchronously C++
=======
R1 Kenichi: typemap feature in Perl/XS
R2 wycc: 讓系統千變萬化的作業環境
R1 Team Yamanekko: mruby develoment with Eclipse
R0 大貓:那些函數語言Tutorial沒教我的事
R1 Mikimoto: 2013 年了還在搞輸入法?
R1 Richard lee: Using CocoaPods for Objective-C Library Management.
@xatier
xatier / 殺手 JC 的告白
Created February 20, 2013 03:40
殺手 JC 的告白,某 popo hacked 事件
作者: JokerCatz (JokerCatz) 看板: Soft_Job
標題: Re: [討論] 維護者、道德與安全
時間: Wed Feb 20 10:52:05 2013
A...首先抱歉其實不太會用BBS
"城邦網留言「囧」暱稱 熱心駭客獲緩起訴"
http://0rz.tw/LIDpl
我是這篇新聞的作者與被告劉先生
@xatier
xatier / gist:4942457
Created February 13, 2013 05:15
suck apple builtin tools ...
$ /bin/bash --version
GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)
Copyright (C) 2007 Free Software Foundation, Inc.
$ /usr/bin/emacs__ --version
GNU Emacs 22.1.1
Copyright (C) 2007 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
anyasu:~ root# hugs
__ __ __ __ ____ ___ _________________________________________
|| || || || || || ||__ Hugs 98: Based on the Haskell 98 standard
||___|| ||__|| ||__|| __|| Copyright (c) 1994-2005
||---|| ___|| World Wide Web: http://haskell.org/hugs
|| || Bugs: http://hackage.haskell.org/trac/hugs
|| || Version: September 2006 _________________________________________
Haskell 98 mode: Restart with command line option -98 to enable extensions
@xatier
xatier / gist:4714257
Last active December 12, 2015 04:28
brianfuck on iPad mini
anyasu:~ root# uname -a
Darwin anyasu 13.0.0 Darwin Kernel Version 13.0.0: Wed Oct 10 23:30:00 PDT 2012; root:xnu-2107.2.34~2/RELEASE_ARM_S5L8942X iPad2,5 arm P105AP Darwin
anyasu:~ root# cat hw.b
+++++ +++++ initialize counter (cell #0) to 10
[ use loop to set the next four cells to 70/100/30/10
> +++++ ++ add 7 to cell #1
> +++++ +++++ add 10 to cell #2
> +++ add 3 to cell #3
> + add 1 to cell #4
<<<< - decrement counter (cell #0)
@xatier
xatier / gist:4692417
Last active December 12, 2015 01:38
$p 是 plurk 的 API ,請參考其他機器人的 code Usage: 給定一個 plurk link ,http://www.plurk.com/p/i3dryq 看 source 可以拿到該噗的 plurk_id => data-pid="1094072786"> 傳給這個 function 即可得到統計資料 原理:爬回應的好友交集,假若交集愈大的話愈可能是匿名噗的主人
sub guess_anon_by_pid {
my $pid = shift;
my %pool;
my @rank = ();
my $response = $p->callAPI('/APP/Responses/get', plurk_id => $pid);
for my $f_list (keys $response->{friends}) {
my $fri = $p->callAPI('/APP/FriendsFans/getFriendsByOffset', user_id => $f_list, limit => 300);
for (@$fri) {
$pool{$_->{display_name}}++ if ($_->{display_name});
-- Empty module to serve as the default current module.
module Hugs where
-- 3 -----------------------------------------------------------------
-- (a
-- 先前算過的 value 會記憶起來,後面要用的時候可以直接 reference 到他
-- 8 + 0 = 8
-- (b
-- 不會先記憶算過的 value,所以每次用到都要重新算過