This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.xpirator.db; | |
import java.sql.SQLException; | |
import com.j256.ormlite.android.AndroidCompiledStatement; | |
import com.j256.ormlite.android.AndroidDatabaseResults; | |
import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper; | |
import com.j256.ormlite.stmt.PreparedQuery; | |
import com.j256.ormlite.stmt.StatementBuilder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
############################################### | |
# | |
# grokDir.rb | |
# | |
# Version 0.1 | |
# | |
# > ruby grokDir.rb -d "c:/Logs/**/*.log" -p "%{DATESTAMP:timestamp}" | |
# | |
############################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# change prefix key | |
set -g prefix C-a | |
unbind C-b | |
bind C-a send-prefix | |
# 'v' key for selection | |
bind-key -t vi-copy 'v' begin-selection | |
# base index | |
set -g base-index 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TaskBuilder.prototype.falldown = function(func, handler) { | |
var self = this; | |
Q.fcall(func).then(function(cb) { | |
return function(next) { | |
cb(function(fn, args) { | |
fn(args, next); | |
}); | |
}; | |
}).then(function(cb) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A => B | |
trait Functor[F[_]] { | |
def fmap[A, B](f: A => B): F[A] => F[B] | |
} | |
// F[A => B] | |
trait Applicative[F[_]] extends Functor[F] { | |
def pure[A](a: A): F[A] | |
def apply[A, B](f: F[A => B]): F[A] => F[B] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 7.3.2 Capturing type constraints from Joshua's "Scala in Depth" | |
scala> def pop[A, C <: Seq[A]](col : C) = col.head | |
scala> pop(List(1, 2)) | |
// error: inferred type arguments [Nothing,List[Int]] do not conform to method pop's type parameter bounds [A,C <: Seq[A]] | |
// pop(List(1, 2)) | |
// ^ | |
scala> def pop[C, A](col : C)(implicit ev: C <:< Seq[A]) = col.head | |
scala> pop(List(1, 2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 7.4.1 Heterogeneous typed list | |
/* | |
Scala는 오버로딩과 오버라이딩 다형성을 안 좋아함. | |
오버로딩은 파라미터의 타입이 런타임시에 지워져 버림 | |
오버라이딩은 상속을 해야한다는 제한 있음. | |
Scala는 타입 생성자를 이용한 다형성을 좋아함. | |
*/ | |
sealed trait HList {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
exec scala -savecompiled "$0" "$@" | |
# Output | |
# -------------------------------------------------------- | |
# Node(1,Node(2,Leaf(4),Leaf(5)),Node(3,Leaf(6),Leaf(7))) | |
# ======================================================== | |
# size 7 | |
# height 3 | |
# leafCount 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo tshark -o "ssl.desegment_ssl_records: TRUE" \ | |
-o "ssl.desegment_ssl_application_data: TRUE" \ | |
-o "ssl.keys_list:192.168.0.1,443,http,your.key.pem" \ | |
-o "ssl.debug_file:ssldebug.log" \ | |
-f "tcp port 443" \ | |
-R "ssl" \ | |
-V -x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream php-phabricator-handler { | |
server unix:/run/php/php7.0-fpm.sock; | |
} | |
server { | |
listen 80; | |
server_name proj.felixlab.io; | |
return 301 https://$host$request_uri; | |
} |
OlderNewer