Skip to content

Instantly share code, notes, and snippets.

View Nitive's full-sized avatar

Maxim Samoilov Nitive

View GitHub Profile
@Nitive
Nitive / stylus.styl
Last active August 29, 2015 14:20
CSS multiline text-overflow ellipsis
/* Original code from http://codepen.io/martinwolf/pen/qlFdp */
p
font-size 21px
line-height 1.2
lines-to-show = 3
display block /* Fallback for non-webkit */
display -webkit-box
max-width 400px
height @font-size * @line-height * lines-to-show /* Fallback for non-webkit */
@Nitive
Nitive / fonts.styl
Last active November 12, 2015 08:57 — forked from diogomoretti/fonts.styl
// font-face mixin
font-url(file)
return 'fonts/' + file
webfont(family, file, weight = normal)
@font-face
font-family family
file += '/' + file
src url(font-url(file + '.eot')),
url(font-url(file + '.woff')) format('woff'),
@Nitive
Nitive / fast_browserify.coffee
Last active August 29, 2015 14:20
gulp + browserify + watchify + error notify + coffeescript
# npm install gulp-uglify browser-sync gulp-notify browserify vinyl-source-stream gulp-streamify watchify gulp-if colors gulp --save-dev
uglify = require 'gulp-uglify'
sync = require 'browser-sync'
notify = require 'gulp-notify'
browserify = require 'browserify'
source = require 'vinyl-source-stream'
streamify = require 'gulp-streamify'
watchify = require 'watchify'
gulpif = require 'gulp-if'
colors = require 'colors'
@Nitive
Nitive / shri.js
Last active August 29, 2015 14:27 — forked from verkholantsev/shri.js
/**
* Реализация API, не изменяйте ее
* @param {string} url
* @param {function} callback
*/
function getData(url, callback) {
var RESPONSES = {
'/countries': [
{name: 'Cameroon', continent: 'Africa'},
{name :'Fiji Islands', continent: 'Oceania'},
@Nitive
Nitive / life-game.clj
Last active December 6, 2015 18:29
Life game before learning Clojure and reading SICP
(ns life-game)
(use '[clojure.string :only (join)])
(def n 30)
(def table
(->>
(range n)
(map (fn [x] n))
(map (fn [x] (into [] (map (fn [x] (Math/round (rand)))
(range x)))))
@Nitive
Nitive / store.md
Last active January 25, 2016 17:41
let store = null
const listeners = []
​
export const getStore = () => store
​
export const subscribe = fn => {
  listeners.push(fn)
+  return () => listeners.filter(l => l !== fn) // return `unsubscribe` function
}
@Nitive
Nitive / esnextbin.md
Created February 15, 2016 07:17
esnextbin sketch
@Nitive
Nitive / esnextbin.md
Last active March 16, 2016 18:11
esnextbin sketch
@Nitive
Nitive / index.js
Last active March 16, 2016 18:35
function wrap to chain lodash/underscore/whatever functions with plain js class methods
import { compact, uniq, take } from 'lodash'
const wrap = function (fn, ...args) {
return fn(this, ...args)
}
const exampleData = [
{ date: '03/12/2012', text: '12 марта' },
{ date: '03/13/2012', text: '13 марта' },
@Nitive
Nitive / clojure.md
Last active April 4, 2016 17:15
Материалы по Clojure и ClojureScript

На русском:

  • Изучите X за Y минут, где X = Clojure ⬈ learnxinyminutes.com
  • Видеокурс «ClojureScript для JavaScript программистов» ⬈ youtube.com
  • Clojure, или «Вы все еще используете Java? Тогда мы идем к вам!» ⬈ fprog.ru

Полезный софт:

  • leiningen — система автомитизации и менеджер зависимостей.
  • planck — ClojureScript REPL

Библиотеки: