Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure 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
class Application extends Controller { | |
case class LoginData(user: String, pass: String) | |
private val loginFormConstraints = Form(mapping("user" -> nonEmptyText, "pass" -> nonEmptyText))(LoginData.apply)(LoginData.unapply) | |
def showLogin = Action { | |
OK(views.html.login) | |
} | |
private def authenticate(user: String, pass: String): Future[AuthResponse] = ??? |
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 gulp = require('gulp'); | |
var browserify = require('browserify'); | |
var babelify = require('babelify'); | |
var del = require('del'); | |
var source = require('vinyl-source-stream'); | |
var _ = require('lodash'); | |
var extReplace = require('gulp-ext-replace'); | |
var less = require('gulp-less'); | |
var gulpMerge = require('merge-stream'); | |
var ngTemplates = require('gulp-ng-templates'); |
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
.vimrc | |
" Map leader to comma | |
let maplocalleader="," | |
" Toggle this for vim-sexp to not go into insert mode after wrapping something | |
let g:sexp_insert_after_wrap = 0 | |
" Toggle this to disable automatically creating closing brackets and quotes | |
let g:sexp_enable_insert_mode_mappings = 1 | |
Vocab |
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
package main | |
import ( | |
"database/sql" | |
"encoding/json" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"net/http" | |
"time" |
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
sudo apt-get install python-glade2 python-appindicator | |
git clone https://github.com/Kilian/f.lux-indicator-applet.git | |
cd f.lux-indicator-applet | |
chmod +x setup.py | |
sudo ./setup.py install | |
fluxgui |
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
# config/routes.rb | |
resources :documents do | |
scope module: 'documents' do | |
resources :versions do | |
post :restore, on: :member | |
end | |
resource :lock | |
end | |
end |
App | Description | Implementations |
---|---|---|
Dependency solver | https://github.com/erlware/relx/blob/master/src/rlx_depsolver.erl (needs to become separate app) | |
Semver parser | Strict semver 2.0.0 parser | https://github.com/nox/mouture |
Fetcher | Given URI and path, download content at URI to path (support http, git, hg, svn, ...) | |
Naive version parser | Non-semver version parser | |
Unpacker | Open tar, zip, 7z, ... | |
Index | ||
Sign/verify packages | ||
Command line parser |
##Cake Pattern and Why Cake Patterns Sometimes Look Different The cake pattern is typically described as a way to use small layers of functionality to create a larger, more complex program. This area of application design is typically designed with application scalability not in the pure performance sense, but in the sense of scaling the application up to more complex functionality and maintainability over time.
There have been many papers and blogs on this aspect, but a few especially helpful blogs include:
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
# Hack to change the Rails cookie serializer from Marshal to JSON and therefore allow the session | |
# to be shared between different languages but also avoid that someone knowing the | |
# cookie secret key could execute arbitrary code on the server by unmarshalling | |
# modified Ruby code added to the session/permanent cookie. | |
# | |
# Note that all users will beed to login again since both the remember me cookie and the session cookies | |
# won't be valid. Note also that the remember me cookie is tested multiple times per request even when it fails. | |
# for performance reasons you might want to delete it if these extra cycles are too costly for you. | |
# | |
# Rails 4 (not tested on Rails 3). |