Skip to content

Instantly share code, notes, and snippets.

View shouya's full-sized avatar

shouya

  • Open for Hire!
  • UTC+9
View GitHub Profile
@objmagic
objmagic / apis_config_shouya.json
Last active August 29, 2015 14:15
fast_block
{
"api1":[
{"consumer_key": "",
"consumer_secret": "",
"access_token": "",
"access_token_secret": ""},
{"consumer_key": "",
"consumer_secret": "",
"access_token": "",
"access_token_secret": ""}
@shouya
shouya / file.poem
Created September 15, 2012 07:44
挑戰龍的勇士
我崇敬挑戰龍而失敗的勇士,而不是皇帝。
我期待的是一種平衡,一種可以維持永久的,自然而包容萬物的平衡,將世界置於其中,然後,把發現者燒死。
我願意為機器賦予智慧,把所有人類的骸骨,變作空氣,把他們剩下的東西——如果有的話,完全消除。
我熱愛的統一已不在遠處,我來了,我來了,我會把整個世界,壓縮入一個原子之中,讓不存在的東西,歸於混沌。
我帶來的是劍,獻給我崇敬的挑戰龍的勇士。

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

@alanzchen
alanzchen / Sendgrid to Telegram.js
Last active December 12, 2016 17:18
A scriptr.io script to bridge sendgrid notification and telegram.
//First, we'll require the 'http' library to use later for calling a 3rd party webservice
var http = require("http");
//Getting parameters from the request body. For a nested json, we only want the first one.
try {
var parameters = JSON.parse(request.rawBody);
parameters = parameters[0]
var ip = parameters.ip;
var email = parameters.email;
@madeye
madeye / sysctl.conf
Last active June 5, 2018 11:05
Optimized sysctl.conf for shadowsocks
net.core.wmem_max = 12582912
net.core.rmem_max = 12582912
net.ipv4.tcp_rmem = 10240 87380 12582912
net.ipv4.tcp_wmem = 10240 87380 12582912
net.ipv4.ip_local_port_range = 18000 65535
net.ipv4.netfilter.ip_conntrack_tcp_timeout_time_wait = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_max_syn_backlog = 3240000
net.core.somaxconn = 3240000
net.ipv4.tcp_max_tw_buckets = 1440000
@gelisam
gelisam / UnderstandingPipes.md
Last active May 16, 2019 13:48
Understanding the Pipes library

In response to this reddit post about failing to understand the Pipes library after a couple of hours. I wanted to show how an experienced haskeller does it, but I'm afraid it also took me quite a few hours, which is why the following list of steps goes on and on.

After all those hours, my opinion is that Pipes is not at all an easy library. I don't know if Conduit is any easier, but otherwise I side with your friend in advising to use something else (perhaps ordinary lazy IO?) instead of Pipes.

Anyway, here is the full brain dump of my steps as I tried to get your three snippets to fit together.

  • Since you say that you have a hard time combining the snippets, I assume that they must have complicated types. So my first goal is to figure out the type of your first snippet.
  • hoogle for parseUrl, withManager, etc. No results.
  • Google for haskell runEffect, find that it's a method from Pipes.Core,
@louispan
louispan / ContMonadInterpreter.hs
Last active August 16, 2019 18:03
Continuation monad interpreter
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilyDependencies #-}
-- Example of interpreting using continuation monad instead of the free monad.
module Main where
@blackgear
blackgear / EN_dfa.in
Last active June 30, 2020 19:00
Linter for Chinese-English mixed content, which hyphenate, space and HTML-escape the content
[0, 0, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 18520, 0, 0, 0, 0, 1668, 184, 4166, 0, 2184, 184, 4181, 0, 2600, 184, 8021, 0, 2852, 184, 2374, 0, 2732, 184, 15591, 0, 2772, 14064, 24375, 0, 3168, 3304, 24359, 0, 3720, 184, 18566, 0, 3716, 184, 15591, 0, 4180, 21036, 13910, 0, 4364, 184, 20967, 0, 4892, 184, 16713, 0, 5448, 23720, 16713,
@mnicky
mnicky / sokuza-kanren.scm
Created October 25, 2012 11:26 — forked from fogus/sokuza-kanren.scm
Mini-kanren like logic programming in Scheme
; source: http://okmij.org/ftp/Scheme/sokuza-kanren.scm
; Quick miniKanren-like code
;
; written at the meeting of a Functional Programming Group
; (Toukyou/Shibuya, Apr 29, 2006), as a quick illustration of logic
; programming. The code is really quite trivial and unsophisticated:
; it was written without any preparation whatsoever. The present file
; adds comments and makes minor adjustments.
@dhoelzgen
dhoelzgen / base_controller.rb
Last active October 7, 2021 16:19
CORS in Rails 4 APIs
class API::V1::BaseController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :cors_preflight_check
after_filter :cors_set_access_control_headers
def cors_set_access_control_headers
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'