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
| 1. pip install -r reqs.pip | |
| 2. server.py | |
| 3. open client.html in browser | |
| 4. redis-cli publish push '123456' | |
| 5. check browser console |
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
| server { | |
| listen 80; | |
| server_name mysite.com; | |
| root /var/www/mysite.com/; | |
| location / { | |
| if (-f $document_root/maintenance.html) { | |
| return 503; | |
| } | |
| ... # the rest of your config goes here |
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
| [user] | |
| name = Pavan Kumar Sunkara | |
| email = pavan.sss1991@gmail.com | |
| [core] | |
| editor = vim | |
| whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
| [sendemail] | |
| smtpencryption = tls | |
| smtpserver = smtp.gmail.com | |
| smtpuser = pavan.sss1991@gmail.com |
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
| (def requirements_file "requirements.txt") | |
| (use 'clojure.java.io) | |
| (use '[clojure.string :only (join split)]) | |
| (slurp requirements_file) | |
| (defn process-line [line] | |
| (let [single-line (split line #"==") | |
| result (into '() single-line)] | |
| (reverse result))) |
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
| user> (defn c [p] | |
| (with-open [rdr (clojure.java.io/reader p)] | |
| (reduce + (map count (line-seq rdr))))) | |
| #'user/c | |
| user> (bench/quick-bench | |
| (c "/tmp/test")) | |
| WARNING: Final GC required 356.7754050400232 % of runtime | |
| Evaluation count : 6 in 6 samples of 1 calls. | |
| Execution time mean : 525.040480 ms | |
| Execution time std-deviation : 29.017225 ms |
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
| (def open-for-business? (atom true)) | |
| (def haircut-count (agent 0)) | |
| (def waiting-room (ref [])) | |
| (def waiting-room-size 3) | |
| (defn open-shop [duration] | |
| (do (Thread/sleep duration) (swap! open-for-business? not))) | |
| (defn add-customers [] | |
| (future |
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
| ;; Anything you type in here will be executed | |
| ;; immediately with the results shown on the | |
| ;; right. | |
| (first [1 2 3]) | |
| (rest [1 2 3]) | |
| (nth [1 2 3] 2) | |
| (conj [1] [1 2 3]) | |
| (cons '(1) [1 2 3]) | |
| (cons [1] [1 2 3]) |
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
| (defmacro def-curry-fn [name args & body] | |
| {:pre [(not-any? #{'&} args)]} | |
| (if (empty? args) | |
| `(defn ~name ~args ~@body) | |
| (let [rec-funcs (reduce (fn [l v] | |
| `(letfn [(helper# | |
| ([] helper#) | |
| ([x#] (let [~v x#] ~l)) | |
| ([x# & rest#] (let [~v x#] | |
| (apply (helper# x#) rest#))))] |
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
| <div class="container"> | |
| <div class="row"> | |
| <div class="col-md-5"> | |
| <div class="panel panel-primary"> | |
| <div class="panel-heading"> | |
| <span class="glyphicon glyphicon-comment"></span> Chat | |
| <div class="btn-group pull-right"> | |
| <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"> | |
| <span class="glyphicon glyphicon-chevron-down"></span> | |
| </button> |
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
| body { | |
| background: url(http://lorempixel.com/1920/1920/city/9/) no-repeat center center fixed; | |
| -webkit-background-size: cover; | |
| -moz-background-size: cover; | |
| -o-background-size: cover; | |
| background-size: cover; | |
| } | |
| .panel-default { | |
| opacity: 0.9; |