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
[1]dim@aldan-3l ~/Work/Scala $ activator new ysubs play-java | |
Fetching the latest list of templates... | |
Could not fetch the updated list of templates. Using the local cache. | |
Check your proxy settings or increase the timeout. For more details see: | |
http://typesafe.com/activator/docs | |
OK, application "ysubs" is being created using the "play-java" template. |
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
module Main where | |
import Debug.Trace | |
foreign import getStringProp | |
"function getStringProp(obj) {\ | |
\ return function (prop) {\ | |
\ return obj[prop];\ | |
\ };\ | |
\}" :: forall a. a -> String -> String |
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
var mainApp = angular.module('mainApp', [ | |
'angular-websocket', | |
'ngRoute', | |
'appCtrl', | |
]) | |
.config(function(WebSocketProvider){ | |
WebSocketProvider | |
.prefix('') | |
.uri("ws://127.0.0.1:8080/"); | |
}); |
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
;; That one works: | |
(defroutes all-routes | |
(GET "/req" req (str req))) | |
(def endpoint {:on-message (fn [channel message] | |
(websocket-message-received message channel)) | |
:on-close (fn [channel {:keys [code reason]}] | |
(websocket-channel-closed channel code))}) |
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 current-page (atom nil)) | |
(def history (History.)) | |
(defn change-page [newPage] | |
(.setToken history newPage) | |
(reset! current-page newPage)) | |
... |
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
(defun my-send-to-nrepl () | |
(interactive) | |
(let ((p (point))) | |
(cider-eval-last-sexp 't) | |
(goto-char p) | |
(insert " ;;=> "))) | |
(defun my-send-to-nrepl2 () | |
(interactive) | |
(let ((p (point))) |
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
(ns my.core | |
(:require ... | |
[ring.middleware [multipart-params :as mp]])) | |
(defn upload-picture [{:keys [tempfile content-type filename]}] | |
(let [ext (.substring content-type (inc (.lastIndexOf content-type "/"))) | |
id (:id (session/get :user))] | |
(if (or (nil? tempfile) | |
(nil? id)) |
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
(defun string/starts-with (s arg) | |
(cond ((>= (length s) (length arg)) | |
(string-equal (substring s 0 (length arg)) arg)) | |
(t nil))) | |
(defun chomp (str) | |
(while (string-match "\\`\n+\\|^\\s-+\\|\\s-+$\\|\n+\\'" | |
str) | |
(setq str (replace-match "" t t str))) | |
str) |
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
(global-ede-mode t) | |
(ede-enable-generic-projects) | |
(require 'ede/generic) | |
(defclass ede-haskell-project (ede-generic-project) | |
((buildfile :initform ".cabal")) | |
"Haskell project.") | |
(defmethod initialize-instance ((this ede-haskell-project) &rest fields) | |
(call-next-method) |
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
(defmacro macro1 (name) | |
name) | |
(defmacro macro2 (name) | |
'(name)) | |
(defmacro macro3 (name) | |
`(,name)) | |
;; #123456789012345678901234567890123456789012345678901234567890 |