Scalaの記事です。Haskellはあまり書けません。
Iterateeの複雑さから開放されたいのでPipe系ライブラリ使いましょうという記事です。
Iterateeとの比較や簡単な使い方についてつらつらと書いていきます。
| ;;; js-beautify.el -- beautify some js code | |
| (defgroup js-beautify nil | |
| "Use jsbeautify to beautify some js" | |
| :group 'editing) | |
| (defcustom js-beautify-args "--jslint-happy --brace-style=end-expand --keep-array-indentation" | |
| "Arguments to pass to jsbeautify script" | |
| :type '(string) | |
| :group 'js-beautify) |
| <?php | |
| Slim::hook('slim.before.dispatch', function () { | |
| list( $type, $controller_name, $controller_action ) = array_merge( explode( '.', Slim::router()->current()->getName() ), array( null,null,null ) ); | |
| if( $type == 'controller' ) { | |
| $file = './controllers/'.$controller_name.'.controller.class.php'; | |
| if( !is_readable( $file ) ) { return false; } | |
| require_once( './controllers/base.controller.class.php' ); | |
| require_once( $file ); | |
| $class = $controller_name.'Controller'; |
| #!/usr/bin/python | |
| # Connects to localhost, 27017 by default | |
| import sys | |
| import pymongo | |
| import time | |
| if len(sys.argv) < 2: | |
| print >> sys.stderr, "Usage: ./tail_profile.py <dbName> [hostname] [port]" | |
| sys.exit(-1) |
| <?php | |
| class DefaultController extends Controller | |
| { | |
| /** | |
| * Dashboard page. | |
| * @Permissions(perm="dashboard_view") | |
| * @Route("/", name="ITEDashboardBundle_index") | |
| * @Template() | |
| * @return array |
| package mojolly.io | |
| import org.jboss.netty.bootstrap.ClientBootstrap | |
| import org.jboss.netty.channel._ | |
| import socket.nio.NioClientSocketChannelFactory | |
| import java.util.concurrent.Executors | |
| import org.jboss.netty.handler.codec.http._ | |
| import collection.JavaConversions._ | |
| import websocketx._ | |
| import java.net.{InetSocketAddress, URI} |
| body#-webkit-web-inspector #main{background-color:#002b36!important}body#-webkit-web-inspector #main .panel.network,body#-webkit-web-inspector #main .panel.timeline,body#-webkit-web-inspector #main .panel.profiles,body#-webkit-web-inspector #main .panel.audits,body#-webkit-web-inspector #main .panel.extension{background-color:#fff!important}body#-webkit-web-inspector #console-messages a:hover,body#-webkit-web-inspector #console-messages .console-formatted-function,body#-webkit-web-inspector #console-messages .console-formatted-object{color:#93a1a1!important}body#-webkit-web-inspector #console-prompt,body#-webkit-web-inspector #console-messages a,body#-webkit-web-inspector #console-messages .console-message,body#-webkit-web-inspector #console-messages .console-group-messages .section .header .title{color:#839496!important}body#-webkit-web-inspector #console-messages .console-formatted-null,body#-webkit-web-inspector #console-messages .console-formatted-undefined{color:#657b83!important}body#-webkit-web-inspect |
| // simple example of the cake pattern | |
| // abstract DAO trait | |
| trait Repository[A, B]{ | |
| // saves an entity, returns an ID | |
| def save(entity: A): B | |
| // more features.. | |
| } | |
| trait RdbmsRepository extends Repository[MyUserCaseClass, Long]{ |
| /** | |
| * A monad to abstract dependencies in the code, see https://coderwall.com/p/kh_z5g | |
| */ | |
| object Reader { | |
| /** | |
| * an implicit to convert a function A => B in a Reader[A, B] | |
| */ | |
| implicit def reader[C, R](block: C => R): Reader[C, R] = Reader(block) |
| ' http://support.microsoft.com/kb/291296/en-us | |
| ' http://superuser.com/questions/130592/how-do-you-force-excel-to-quote-all-columns-of-a-csv-file | |
| ' - change integer to long indexing | |
| ' http://stackoverflow.com/questions/2524703/save-text-file-utf-8-encoded-with-vba | |
| ' - output utf8 content | |
| Sub QuoteCommaExport() | |
| ' Dimension all variables. | |
| Dim DestFile As String | |
| Dim FileNum As Integer |