Skip to content

Instantly share code, notes, and snippets.

@TareqElMasriDev
TareqElMasriDev / bundles.txt
Created March 9, 2017 14:48
ZSH Antibody bundles
# this block is in alphabetic order
caarlos0/git-add-remote kind:path
caarlos0/jvm
caarlos0/ports kind:path
caarlos0/zsh-git-fetch-merge kind:path
caarlos0/zsh-git-sync kind:path
caarlos0/zsh-mkc
caarlos0/zsh-open-pr kind:path
mafredri/zsh-async
Tarrasch/zsh-bd

Raise Open File Limits in OS X

in OS X 10.4 to macOS sierra 10.12 and maybe higher!

Create Launcher Script:

/Library/LaunchDaemons/limit.maxfiles.plist

Copy this entire code block and paste it into your terminal and push Return to create this file for you with correct permissions. It will (probably) ask for your password:

@micahjon
micahjon / loadScript.js
Last active November 5, 2017 12:59
Promise-based Asynchronous Script Loader
/**
* Loads javascript file by url and saves reference to it by name, so it's not loaded again
* @param {string} name Name of js library
* @param {string} url Url to js library
* @return {promise} Resolves when library is loaded
*
* Based on example by Brad Berger: https://bradb.net/blog/promise-based-js-script-loader/
* Extended w/ global variable to keep track of previously loaded scripts.
* Removed support for loading several independent scripts at once via Promise.all()
*
@slugbyte
slugbyte / trello-github-workflow.md
Last active June 6, 2019 09:22
Trello and Github Workflow

Team Project Workflow with Git and Trello

List Organization

  • Files
    • a card for every file in the project
  • Names
  • a list of all the names of the people each assigned a different color
  • Tasks
  • a list of features that need to be implemented
@adjavaherian
adjavaherian / sass-collector.js
Created July 28, 2015 01:53
Webpack plugin to collect different stylesheets.
var ModuleParserHelpers = require('webpack/lib/ModuleParserHelpers');
var NullFactory = require('webpack/lib/NullFactory');
var _ = require('lodash');
var path = require('path');
var sass = require('node-sass');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var ExtractTextPlugin__dirname = path.dirname(
require.resolve('extract-text-webpack-plugin'));
var visited = {};
@nolanlawson
nolanlawson / protips.js
Last active February 4, 2024 18:06
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@Couto
Couto / webpack.js
Last active November 11, 2020 17:53
Fetch polyfill with webpack
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
var folders = {
APP: path.resolve(__dirname, '../app'),
BUILD: path.resolve(__dirname, '../build'),
BOWER: path.resolve(__dirname, '../bower_components'),
NPM: path.resolve(__dirname, '../node_modules')
};
@jamesgpearce
jamesgpearce / dimoc.md
Last active September 22, 2017 23:34
DIMOC: Do It Myself or Callback - a simple pattern for React components

TLDR: a React component should either manage its own state, or expose a callback so that its parent can. But never both.

Sometimes our first impulse is for a component to entirely manage its own state. Consider this simple theater seating picker that has a letter for a row, and a number for a seat. Clicking the buttons to increment each value is hardly the height of user-interface design, but never mind - that's how it works:

/* @flow */
var React = require('react');

var Letter: React.ReactClass = React.createClass({
  getInitialState: function(): any {