This file contains hidden or 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
| # Usage: `setjdk 1.7` or `setjdk 1.8` | |
| function removeFromPath() { | |
| export PATH=$(echo $PATH | sed -E -e "s;:$1;;" -e "s;$1:?;;") | |
| } | |
| function setjdk() { | |
| if [ $# -ne 0 ]; then | |
| removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin' | |
| if [ -n "${JAVA_HOME+x}" ]; then | |
| removeFromPath $JAVA_HOME |
This file contains hidden or 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 'dart:html'; | |
| import 'dart:math'; | |
| import 'dart:async'; | |
| var ctx; | |
| List<Point> snake = [new Point(12, 10)]; | |
| Point direction = new Point(1, 0); | |
| Point food; | |
| void main() { |
This file contains hidden or 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
| state = | |
| dir: x: 1, y: 0 | |
| canvas = -> | |
| can = document.getElementById("game") | |
| ctx = can.getContext("2d") | |
| width = can.width | |
| height = can.height | |
| ctx.fillStyle = "black" |
This file contains hidden or 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
| (ns hello-cljs.main) | |
| (defn log [str] | |
| (.log js/console str)) | |
| (def state (atom {:direction [1 0]})) | |
| (defn canvas [] | |
| (let [canvas (.getElementById js/document "game") | |
| ctx (.getContext canvas "2d") |
This file contains hidden or 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 snake | |
| import scala.util.{Random} | |
| import swing.{SimpleSwingApplication, MainFrame, Panel, event} | |
| import event.{KeyPressed} | |
| object App extends SimpleSwingApplication { | |
| import event.Key._ | |
| import java.awt.{Dimension, Graphics2D, Rectangle} | |
| import java.awt.{Color} |