Skip to content

Instantly share code, notes, and snippets.

View march213's full-sized avatar
πŸ¦„

Jane Molodetskaya march213

πŸ¦„
View GitHub Profile
@march213
march213 / style.css
Created July 31, 2018 16:16
Default styles with responsive typography
@charset "UTF-8";
html{
font-family:"PT Serif", Georgia, serif;
font-size:100%;
line-height:1.6;
background:#fff;
color:#000;
-webkit-overflow-scrolling:touch; }
body{
@march213
march213 / .eslintrc
Created June 10, 2018 04:32 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%
}
body {
margin: 0
}
var T2 = (()=>{
// todo: mixins collection
class Foo {
foo () {
this.__super();
console.log(this.bar());
}
bar() {console.log('bar')}
}
const isObject = value => value === Object(value)
const isArray = value => Array.isArray(value)
const isFile = value => value instanceof File
const makeArrayKey = (key) => {
if (key.length > 2 && key.lastIndexOf('[]') === key.length - 2) {
return key
} else {
return key + '[]'
}
}
@march213
march213 / .gitignore
Last active August 16, 2017 13:41
base gitignore
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
#!/usr/bin/env ruby
require 'open-uri'
require 'pathname'
require 'json'
def strip_hash(f)
ext = f.extname
if ext.include?("?")
@march213
march213 / array_iteration_thoughts.md
Created January 17, 2017 13:55 — forked from ljharb/array_iteration_thoughts.md
Array iteration methods summarized

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and