Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / yukelog.rb
Created April 28, 2012 11:48
yukelog
#! /usr/bin/ruby -Ku
$udid = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
HOST = 'yukeyusha4iphone.appspot.com'
YYVER = '3.0.1'
require 'net/https'
require 'rubygems'
require 'json'
@penguin2716
penguin2716 / gray_protected_users.rb
Created July 26, 2012 18:41
鍵垢のツイート背景をグレーにするmikutterプラグイン
#-*- coding: utf-8 -*-
Plugin.create :gray_protected_users do
UserConfig[:protected_users_background_color] ||= [0xcccc,0xcccc,0xcccc]
filter_message_background_color do | mp, array |
if mp.to_message.user[:protected] == true
array = UserConfig[:protected_users_background_color]
end
[mp, array]
end
@nna774
nna774 / gist:3361116
Created August 15, 2012 15:46
オセロ
-- オセロ
--import Data.Functor
import Maybe
import Control.Monad
data Color = Black | White deriving (Eq, Show, Read)
type Cell = Maybe Color
type Board = [[ Cell ]]
@myuon
myuon / gist:3386693
Created August 18, 2012 13:03
SKIコンビネータ2
\abf.fab
= \abf.(I f)(K (ab)f)
= \ab.SI(K(ab))
= \ab.(K(SI)(ab))(K(ab))
= \ab.S(K(SI))K(ab)
= \ab.(K(S(K(SI))K) b)(a b)
= \ab.S(K(S(K(SI))K))ab
= S(K(S(K(SI))K))
@kazu-yamamoto
kazu-yamamoto / gist:4064634
Created November 13, 2012 08:20
Testing Free Monad with QuickCheck
module Main where
import Control.Monad
import Control.Monad.Free
import Prelude hiding (putChar, getChar)
import qualified System.IO as IO
import Test.QuickCheck
----------------------------------------------------------------
-- Our DSL
@mzp
mzp / vvakame.md
Created November 16, 2012 07:11
わかめモナ化.md
@penguin2716
penguin2716 / aieeeee.rb
Created March 6, 2013 17:07
どんなツイートも「アイエエエエエ!」になっちゃうmikutterプラグイン
#-*- coding: utf-8 -*-
Plugin.create :aieeeee do
filter_gui_postbox_post do |gui_postbox|
Plugin.create(:gtk).widgetof(gui_postbox).widget_post.buffer.text = "アイエエエエエ!#{' ' * rand(30)}"
[gui_postbox]
end
end
@satomacoto
satomacoto / create.py
Last active December 15, 2022 10:34
kNN on xvideos.com-db.csv
# -*- coding:utf-8 -*-
from pymongo import MongoClient
client = MongoClient()
db = client.xvideos
def create_db():
f = open('xvideos.com-db.csv')
for line in f:
@CLCL
CLCL / CentOS6-L2TP-IPsec.md
Last active September 26, 2022 18:21
L2TP/IPsec(AndroidやiPhoneからのVPN接続)を経路を用意すべくVPSにL2TP/IPsecサーバを設置するとき、ネットにある情報だとなかなかつながらないから、標準環境としてAWSのCentOS 6.3 x86_64 Release Media(ami-3fe8603e)の起動直後から最短距離で設定する方法をまとめた。

CentOS 6でとにかくL2TP/IPsecサーバ

  • AWSでEC2のインスタンスを借りる
  • 今回は東京リージョンのCentOS 6.3 x86_64 Release MediaのAIM(ami-3fe8603e)でインスタンスを建てる
  • Security Group: L2TP/IPsec(Inbound 22/TCP: SSH, 500/UDP: ISAKMP, 1701/UDP: L2TP, 4500/UDP: IPSec NAT Traversal)を許可
  • ec2-54-249-173-214.ap-northeast-1.compute.amazonaws.com(グローバルIPアドレス:54.249.173.214)にrootでログイン

SELinuxを無効にする

[root@ip-10-132-164-105 ~]# setenforce 0
@geta6
geta6 / catimg(bash)
Last active January 23, 2016 22:35
cat image on xterm256 terminal, zsh or bash
#!/bin/bash
# Modified by Yu-Jie Lin for Bash from zsh version
ORG="$1"
if [[ ${ORG##*.} =~ JPG|jpg|JPEG|jpeg|GIF|gif|PNG|png ]]; then
CATWIDTH=$(tput cols)
SRC=$(mktemp).png