Skip to content

Instantly share code, notes, and snippets.

@vladkotu
vladkotu / media-query.css
Created December 24, 2019 16:29 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@vladkotu
vladkotu / Readme.md
Created October 2, 2019 06:40 — forked from mhuebert/Readme.md
material-ui's CSS-in-JS with Reagent. (see https://material-ui.com/customization/css-in-js/)

material-ui allows for customizing CSS via a higher-order component called withStyles. Like many higher-order components which expect render props, the purpose of withStyles is to accept some parameters, and then introduce a new variable into the scope of the component tree.

One succinct and simple way to translate the concept of scope into Clojure is via a custom let macro. Usage of such a macro is demonstrated here:

(:require [material-ui.styles :as m])

(m/let [{:keys [leftPad]} {:leftPad 
                           {:paddingLeft 8}}]
 ;; `leftPad` is now the _className_ associated with {:paddingLeft 8} 
@vladkotu
vladkotu / gist:a27abe0427596b8a0a84778c661853d3
Created July 10, 2019 12:36 — forked from TessMyers/gist:a252520dd9a8fe68f8e5
Simple exercises using .map and .reduce
// Simple problems to solve using the native .reduce and .map array methods. Each of these problems can be solved in many
// different ways, but try to solve them using the requested higher order function.
// MAP
// Write a function capitalize that takes a string and uses .map to return the same string in all caps.
// ex. capitalize('whoop') // => 'WHOOP'
// ex. capitalize('oh hey gurl') // => "OH HEY GURL"
var capitalize = function(string){
// code code code!
@vladkotu
vladkotu / atom_clojure_setup.md
Last active April 18, 2017 14:39 — forked from jasongilman/atom_clojure_setup.md
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

@vladkotu
vladkotu / es7coreasync.md
Created April 6, 2017 09:00 — forked from shaunlebron/es7coreasync.md
es7 vs core.async

Comparing ES7 and core.async

ES7 core.async
async function() {...} (fn [] (go ...))
await ... (<! ...)
await* or Promise.all(...) (doseq [c ...] (<! c))
@vladkotu
vladkotu / exit_node.js
Last active December 10, 2015 00:29 — forked from anonymous/exit node
// Unpause stream for stdin
process.stdin.resume();
process.stdin.setEncoding('utf8');
// Set raw mode (read by char)
// http://unix.stackexchange.com/questions/21752/whats-the-difference-between-a-raw-and-a-cooked-device-driver
process.stdin.setRawMode(true);
// Subscribe to data retrieving event
process.stdin.on('data', function (chunk) {
// Check if end of data stream reached (http://en.wikipedia.org/wiki/List_of_Unicode_characters)
@vladkotu
vladkotu / gist.js
Created October 8, 2012 13:48 — forked from kris-g/gist.js
Tumblr Gist Embed JavaScript with Auto Hide footer
var gistPrefix = 'https://gist.github.com/',
cachedWrite = document.write,
body = $('body'),
gists = $('p.gist').map(function(n, p) {
p = $(p);
var a = $('a', p),
href = a.attr('href');
if (a.length && href.indexOf(gistPrefix) == 0) {
@vladkotu
vladkotu / jquery.ba-tinypubsub.js
Created October 31, 2011 10:03 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);