I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
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
(ns reagent-test.core | |
(:require [reagent.core :as reagent :refer [atom]] | |
[datascript :as d] | |
[cljs-uuid-utils :as uuid])) | |
(enable-console-print!) | |
(defn bind | |
([conn q] | |
(bind conn q (atom nil))) |
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
(ns leaflet-helloworld | |
(:require [om.core :as om :include-macros true] | |
[om.dom :as dom :include-macros true])) | |
(defn map-view [_ owner] | |
(reify | |
om/IRender | |
(render [_] | |
(dom/div #js {:id "the-map"} nil)) | |
om/IDidMount |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
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 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
# Docker version 1.1.2, build d84a070 | |
FROM ubuntu:14.04 | |
RUN apt-get update && apt-get install -y \ | |
git \ | |
software-properties-common \ | |
python-software-properties \ | |
make\ | |
gcc \ | |
g++ \ |
Last updated: 2017-03-18
exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .
###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs
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
; Following code is WRONG, see comments for details. | |
(defn google-map [] | |
(let [pos (subscribe [:current-position])] | |
(reagent/create-class | |
{:reagent-render | |
(fn [] | |
[:div | |
[:h4 "Map"] | |
[:div#map-canvas {:style {:height "400px"}}]]) |
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
// This will open up a prompt for text to send to a console session on digital ocean | |
// Useful for long passwords | |
(function () { | |
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split(""); | |
function f() { | |
var character = t.shift(); | |
var i=[]; | |
var code = character.charCodeAt(); | |
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1 |
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
#!/bin/bash | |
while sleep 0.5; do vim --startuptime "$@" >(./startup-info) +qall; done | |
# usage: ./collect-times | |
# Running this will collect startup times in `times' directory. | |
# It will run it multiple times so that the averages start converging. | |
# Whenever you remove a plugin, it gets stored as a different version, | |
# which will be shown at 'watch ./watcher'. |