- https://github.com/plexus/chestnut - Chestnut is a Leiningen template for a Clojure/ClojureScript app based on Om, featuring a great dev setup, and easy deployment.
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
| find 10 biggest directories/files | |
| du -a . | sort -n -r | head -n 10 |
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
| var React = require('react'); | |
| var Router = require('react-router'); | |
| var Fluxxor = require('Fluxxor'); | |
| var FluxMixin = Fluxxor.FluxMixin(React); | |
| var StoreWatchMixin = Fluxxor.StoreWatchMixin; | |
| var _ = require('lodash'); | |
| var GridListElement = require('./GridListElement'); | |
| var flux = require('../flux'); |
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
| var NewsfeedStore = Fluxxor.createStore({ | |
| initialize () { | |
| this.loading = false; | |
| this.error = null; | |
| PaginatedStoreWrapper(this); | |
| _.extend(this, (localStorage.get('NewsfeedStore') || {})); | |
| this.bindActions( | |
| AppBarConstants.REFRESH, this.onRefresh, |
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 fetch(hash, *keys, &block) | |
| index = 0 | |
| keys.reduce(hash) do |coll, key| | |
| index += 1 | |
| v = coll[key] | |
| if v | |
| v | |
| else | |
| if !block.nil? && index == keys.size | |
| block.call |
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
| (defn- handle-photo-stream [file size] | |
| (let [bytes-stream (:bytes-stream file) | |
| filename (:filename file)] | |
| (if (empty? filename) | |
| {:error "Missing file" :image nil} | |
| (with-open [in bytes-stream] | |
| (with-open [out (java.io.BufferedOutputStream. (java.io.FileOutputStream. (str "/tmp/" filename)))] | |
| (let [buffer (make-array Byte/TYPE 1)] | |
| (loop [g (.read in buffer) |
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
| git branch --merged | grep -v "\*" | xargs -n 1 git branch -d |
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
| words/**/*.acn | |
| words/**/*.acr | |
| words/**/*.alg | |
| words/**/*.aux | |
| words/**/*.backup | |
| words/**/*.bbl | |
| words/**/*.bcf | |
| words/**/*.blg | |
| words/**/*.brf | |
| words/**/*.dvi |
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
| (let [plot (histogram (sample-normal 20)) | |
| render (-> plot .getPlot .getRenderer)] | |
| (add-histogram plot (sample-normal 20)) | |
| ; changes color of the outline | |
| (.setSeriesOutlinePaint render 1 java.awt.Color/BLUE) | |
| ; does nothing, fill paint remains unchanged. ??????? | |
| (.setSeriesFillPaint render 1 java.awt.Color/BLUE) | |
| (view plot)) |