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
!!! 5 | |
%html | |
%head | |
%title TESTAPP | |
= stylesheet_link_tag "application" | |
= javascript_include_tag "application", "registration" | |
= csrf_meta_tag | |
%body | |
%header | |
%h1#logo |
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
pragma solidity ^0.4.24; | |
contract HelloWorld { | |
} |
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
stack build && stack runghc test/Homework/Week01Spec.hs -v | |
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2 | |
2018-06-26 08:59:58.695588: [debug] Checking for project config at: /Users/ddyba/Code/haskell-cis-194-spring-2017/stack.yaml | |
@(src/Stack/Config.hs:850:9) | |
2018-06-26 08:59:58.696816: [debug] Loading project config file stack.yaml | |
@(src/Stack/Config.hs:876:13) | |
2018-06-26 08:59:58.699047: [debug] Decoding build plan from: /Users/ddyba/.stack/build-plan/lts-5.3.yaml | |
@(src/Stack/Snapshot.hs:164:5) | |
2018-06-26 08:59:58.699139: [debug] Trying to decode /Users/ddyba/.stack/build-plan-cache/lts-5.3.cache | |
@(src/Stack/Snapshot.hs:156:32) |
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
# Movement | |
OPT + CMD + ] => Move a line up | |
OPT + CMD + [ => Move a line down | |
CMD + SHIFT + ] => Move one tab to the right | |
CMD + SHIFT + [ => Move one tab to the left | |
CMD + -> / CTRL + E => Move to the end of the line | |
CMD + <- / CTRL + A => Move to the start of the line | |
OPT + -> => Move forward one word | |
OPT + <- => Move backward one word | |
CTRL + -> => Move forward one word (can move by words inside of camelcased words) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>IDECodeSnippetCompletionPrefix</key> | |
<string>kspec</string> | |
<key>IDECodeSnippetCompletionScopes</key> | |
<array> | |
<string>All</string> | |
</array> |
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
(define (good-enough? guess next-guess) | |
(< (/ (abs (- guess next-guess)) guess) 0.001)) | |
(define (average x y) | |
(/ (+ x y) 2)) | |
(define (improve guess x) | |
(average guess (/ x guess))) | |
(define (sqrt-iter guess x) |
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
(defn update-my-atom [a name] | |
(let [new-state (assoc-in @a [:foo :bar] (merge {:name name}))] | |
(swap! a (fn [old] new-state)))) | |
;; refactored into: | |
(defn get-new-state [state name] | |
(assoc-in state [:foo :bar] (merge {:name name}))) |
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
(defn ^:private progress-input-stream | |
[^java.io.InputStream input-stream size] | |
(let [total-read (atom 0)] | |
(proxy [java.io.InputStream] [] | |
(available [] | |
(.available input-stream)) | |
(close [] | |
(.close input-stream)) | |
(read | |
([] |
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
class Movie < ActiveRecord::Base | |
def self.all_ratings | |
# debugger | |
find_by_sql("SELECT DISTINCT rating FROM movies").map(&:rating) | |
end | |
end |
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 ApplicationHelper | |
def highlight_tag_if(condition, tag, &block) | |
if condition | |
content_tag tag, :class => 'hilite', &block | |
else | |
content_tag tag, &block | |
end | |
end | |
end |
NewerOlder