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
;; Billy Mays here talking about zap to whitespace. | |
;; Deletes your whitespace forward. | |
;; Got to fix indentation before you merge? No problem! | |
(global-set-key "\C-c " 'zap-whitespace-forward) ;; C-c SPC | |
;; But I'm still not done. | |
(defalias 'zap-whitespace-forward 'ash-delete-syntax-forward) | |
;; There's more! | |
;; Delete word characters forward, delete punctuation forward, |
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
def runSecondThenFirst(first: => Unit)(second: => Unit) = { | |
second; | |
first | |
} | |
runSecondThenFirst { | |
println("First") | |
} { | |
println("Second") | |
} |
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 proj | |
object Main extends App |
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
/** | |
* NegNumbers | |
* | |
* A singleton that takes the code out for a spin. | |
*/ | |
object NegNumbers { | |
// Instance: | |
val some = new SomeNumbers { | |
// Defining an abstract member is what instances do best! |
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.lang._ | |
import scala._ | |
import scala.Predef._ | |
import scala.concurrent.Future | |
import scala.concurrent.Await | |
import scala.concurrent.duration._ | |
import scala.concurrent.ExecutionContext.Implicits.global | |
object ComposeFutures extends App { |
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 org.npr.weekendedition.sunday.puzzle.people.will.shortz | |
/** | |
* Find all the permutations of numbers and ops | |
* Build infix expresions | |
* Find all expressions that evaluate within interval (e.g. 1 to 40) | |
* | |
*/ | |
object Main extends App { |
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
// Based on the following Usenet posting | |
// as seen on "Scala: The First Ten Years", Scala Days Berlin, 2014 | |
// From: Miles Sabin | |
// Date: 2004-04-04 10:24:54 GMT | |
// Subject: Member types in Scala | |
// Newgroup: comp.lang.scala | |
package com.milessabin.example |
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
/** | |
* Based on Java listings by Bruce Eckel | |
* Dining Philosophers in Java 8, Dec-29 2016 | |
* http://bruceeckel.github.io/2016/12/29/dining-philosophers-in-java-8/ | |
*/ | |
package concurrent | |
// concurrent/StickHolder.scala |
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
;; Disable `M-p' and `M-n; in Ensime minor mode | |
(eval-after-load "ensime-mode" | |
'(progn | |
(define-key ensime-mode-map (kbd "M-n") nil) | |
(define-key ensime-mode-map (kbd "M-p") nil))) |
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
/** fizzbuzz.c */ | |
#include <stdio.h> | |
#include <string.h> | |
#include <assert.h> | |
#include <limits.h> | |
#include "fizzbuzz.h" | |
const char* fizzbuzz(signed long n) |
OlderNewer