Skip to content

Instantly share code, notes, and snippets.

View timuric's full-sized avatar

Timur Carpeev timuric

View GitHub Profile
@bendc
bendc / functional-utils.js
Last active September 15, 2023 12:12
A set of pure ES2015 functions aimed to make functional JavaScript more idiomatic.
// array utils
// =================================================================================================
const combine = (...arrays) => [].concat(...arrays);
const compact = arr => arr.filter(Boolean);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@bomberstudios
bomberstudios / Post to Campfire.sketchplugin
Created March 26, 2014 16:04
Post to Campfire from Sketch.app — Requires Flint.app
// Post to Campfire (ctrl alt cmd p)
// Setup
var CHAT_ROOM = "Main Room"
var flint = SBApplication.application("Flint"),
msg = [doc askForUserInput:"Post to Campfire:" initialValue:""];
if (msg) {
[flint post:msg toRoom:CHAT_ROOM]
@branneman
branneman / better-nodejs-require-paths.md
Last active April 25, 2024 13:21
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@uhunkler
uhunkler / SketchLayers.jstalk
Last active September 12, 2016 02:59
SketchLayers - JSTalk Sketch
/**
* SketchLayers - a collection of layer related functions
*
* @type {object}
*/
var SketchLayers =
{
collection : [],
selection : function()
@uhunkler
uhunkler / readTextFromFile.jstalk
Last active October 4, 2016 02:48
read and write TextToFile - JSTalk Sketch
/**
* Read text from a file at the given path
*
* @param {string} path given file path
* @return {mixed} string with text if successful, false if error
*/
function readTextFromFile( path )
{
var result = false;
@lexrus
lexrus / .gitignore
Created April 10, 2012 05:13
.gitignore
# Exclude the Podspecs
Pods/*
Podfile.lock
# Exclude any PSD/AI source
#*.psd
#*.ai
# Exclude generated files
VersionX-revision.h