Skip to content

Instantly share code, notes, and snippets.

View mumoshu's full-sized avatar
🏠
Working from home

Yusuke Kuoka mumoshu

🏠
Working from home
View GitHub Profile
@tnoda
tnoda / proposal.org
Last active August 29, 2015 14:10
#scala_kb proposal

12/13(土) 第1回 Scala 関西勉強会プロポーザル

プロポーザル

12/13(土) 第1回 Scala 関西勉強会.次の (1) か (2) のどちらかを予定.

(1) Competitive Scala Programming

前回の

lazy val jsTestServer = task {
val port = "4224"
JsTestDriverServer.main(Array("--port", port))
System.out.println("*****\nNow capture your browser: http://localhost:" + port)
Thread.sleep(86400 * 1000) // Otherwise it exits straight away
None
}
lazy val jsTestClient = task {
@koseki
koseki / Capfile
Created April 23, 2010 13:50
Capistrano Minimal
Dir.chdir(File.dirname(__FILE__))
# load 'deploy' if respond_to?(:namespace) # cap2 differentiator
# Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy' # remove this line to skip loading any of the default tasks
public class A {
public static void main(String[] args) {
A a = new A() {};
System.out.println(a.getClass());
}
}
#!/usr/bin/env xsbtscript
!#
/***
scalaVersion := "2.9.0-1"
libraryDependencies ++= Seq(
"com.mongodb.casbah" %% "casbah-core" % "2.1.5-1"
)
@tbje
tbje / plugins.sbt
Created November 23, 2011 12:09
Different versions of sbt and global plugins
import sbt._
import Defaults._
libraryDependencies <++= (scalaVersion, sbtVersion) {
case (scalaVersion, sbtVersion @ "0.11.0") => Seq(
sbtPluginExtra("name.heikoseeberger.groll" % "groll" % "0.4.0-SNAPSHOT", sbtVersion, scalaVersion), // corresponds to addSbtPlugin("name.heikoseeberger.groll" % "groll" % "0.4.0-SNAPSHOT")
sbtPluginExtra("com.typesafe.sbteclipse" % "sbteclipse" % "1.5.0-SNAPSHOT", sbtVersion, scalaVersion)
)
case (scalaVersion, sbtVersion @ "0.11.1") => Seq(
@cailinanne
cailinanne / cache_book.rb
Created November 28, 2011 03:33
Testing cache clearing with Rails 3.1 and Rspec
#spec/requests/cache_book_spec.rb
require 'spec_helper'
describe "CacheBook" do
# Turn on caching
before do
ActionController::Base.perform_caching = true
ActionController::Base.cache_store = :file_store, "tmp/cache"
FileUtils.rm_rf(Dir['tmp/cache'])
@Koc
Koc / gist:1501185
Created December 20, 2011 10:50
start-stop-daemon php example
#!/bin/sh
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
set -e
NAME="brouzie-php-53"
RUN_AS_USER=brouzie
PHP_FCGI_CHILDREN=3
PHP_FCGI_MAX_REQUESTS=200
@dcarley
dcarley / README.md
Created February 1, 2012 10:49
VirtualBox NAT interface stops responding under load

VirtualBox NAT bug

Pushing a certain quantity/mixture of data through a VB guest's NAT interface causes all TCP/UDP connections to fail for a period of time thereafter.

The only way I've been able to reliably reproduce this is to use pip(1) to download a large list of Python packages. After a number of packages have been downloaded (14~20) pip will exit with an HTTP or DNS timeout. Inbound port-forwarded SSH connections will drop with:

Connection to 127.0.0.1 closed by remote host.

This appears most likely to occur with the Intel PRO/1000 MT Desktop (82540EM) NIC. It is harder to reproduce with PCnet-FAST III (Am79C973) NICs. It is not reproducible with host-only or bridged adapters.

@xuwei-k
xuwei-k / build.sbt
Created April 4, 2012 14:59
watch d_lang source use sbt
{
val script = "hello.d"
seq(
TaskKey[Unit]("dmd") <<= (compile in Compile).map{ _ =>
val ret = ("dmd -run " + script) !;
if(ret != 0)sys.error("compile fail")
}
,
watchSources += file(script)
)