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
scala> import scala.concurrent._ | |
import scala.concurrent._ | |
scala> import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent.ExecutionContext.Implicits.global | |
scala> import scala.concurrent.duration._ | |
import scala.concurrent.duration._ | |
scala> val f1 = future { Thread.sleep(10000000000l); "a" } |
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
import java.util.Date | |
/** | |
* Usage: | |
* | |
* val someFun: String = SimpleCache({ () => somethingExpensive }, 15.minutes).cachedFun | |
* | |
* val theValue = someFun() | |
*/ | |
class SimpleCache[T]( |
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
"trip-step":{ | |
"description":"A step in a trip", | |
"fields":[ | |
{ | |
"name":"departure", | |
"type":[ | |
{ | |
"name":"stop", | |
"type":"stop" | |
}, |
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
craftybeaver@craftybeaver-All-Series:~/Code/node-gtfs$ cd jims-downloads/ && rm -rf * && cd .. | |
craftybeaver@craftybeaver-All-Series:~/Code/node-gtfs$ node scripts/jimTest.js | |
Download successful | |
craftybeaver@craftybeaver-All-Series:~/Code/node-gtfs$ ls -lsah jims-downloads/ | |
total 88K | |
4.0K drwxrwxr-x 4 craftybeaver craftybeaver 4.0K May 31 13:49 . | |
4.0K drwxrwxr-x 10 craftybeaver craftybeaver 4.0K May 30 22:31 .. | |
72K -rw-rw-r-- 1 craftybeaver craftybeaver 69K May 31 13:49 latest.zip | |
4.0K drwxrwxr-x 3 craftybeaver craftybeaver 4.0K May 31 13:49 __MACOSX | |
4.0K drwxrwxr-x 2 craftybeaver craftybeaver 4.0K May 31 13:49 PATH_GTFS_20111109 |
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
private[bulk] | |
def prepareEmailRequestBody(to: String, from: String, subject: String, body: String) = { | |
List( | |
"To: " + to, | |
"From: " + from, | |
"Subject: " + subject | |
).mkString("\r\n") + "\r\n\r\n" + body + "\r\n\r\n-----ET-----386a7a00-8f73-11e3-a781-775966473e19" | |
} |
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
import scala.actors.Future | |
import scala.actors.Futures | |
import java.util.concurrent.atomic.AtomicInteger | |
object Main extends App { | |
val start = System.currentTimeMillis() | |
val sample = scala.io.Source.fromFile("src/main/scala/digitssample.csv") |
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
protected RedirectManager createRedirectManager(final boolean captureOutput) { | |
final String productServiceUrl = "http://localhost:7501/product_service/1.0"; | |
final String captureDir = "./src/test/resources/json/" + getClass().getSimpleName() + "/product_service"; | |
Sales salesClient = SalesFactory.instance(new MapConfig(new HashMap<String, Object>() {{ | |
if (captureOutput) { | |
put(SalesFactory.PRODUCT_SERVICE_URI(), productServiceUrl); | |
put(SalesFactory.CAPTURE_DIR(), captureDir); | |
} | |
else { |
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
#Custom SQL | |
execute "create or replace view vw_feed_parse_stats as (select feed_id, dayofyear(parse_start) dayofyear, feed_items_added from feed_parse_logs group by dayofyear(parse_start), feed_id);" | |
execute "alter table feed_item_categories add constraint category_fk foreign key (category_id) references categories(id);" | |
change_column :feed_item_categories, :feed_item_id, :integer | |
execute "alter table feed_item_categories add constraint feed_item_fk foreign key (feed_item_id) references feed_items(id);" | |
execute "alter table feed_items add constraint feed_fk foreign key (feed_id) references feeds(id);" | |
execute "alter table feed_parse_logs add constraint fpl_feed_fk foreign key (feed_id) references feeds(id);" |