Skip to content

Instantly share code, notes, and snippets.

View baamenabar's full-sized avatar
:octocat:
yeah, that

B. Agustín Amenábar Larraín baamenabar

:octocat:
yeah, that
View GitHub Profile
@maban
maban / Maban Website Contract.md
Last active September 22, 2021 06:49 — forked from malarkey/Contract Killer 3.md
My boilerplate contract

Website Contract [month] [year]

Description of this Contract

This contract is not meant to trick or deceive you; the intention is purely to protect both parties. I have tried to keep the wording as plain as possible, but if anything is unclear, please let me know and I will be more than happy to clarify it with you. Also, until you sign it, please feel free to request to change bits of it to suit your requirements.

In short, [client name] is contracting me, [my name], to [description of my role] between [start date and finish date].

By signing this, you are confirming that you have the power and ability to enter into this contract on behalf of [client's company].

@maroun-baydoun
maroun-baydoun / flatten.ts
Last active March 16, 2021 22:40
Flatten an array of arrays in TypeScript
const flatten = < T = any > (arr: T[]) => {
const reducer = < T = any > (prev: T[], curr: T | T[]) => {
if (curr.constructor !== Array) {
return [...prev, curr];
}
return curr.reduce(reducer, prev);
};
return arr.reduce(reducer, []);
};
@floatdrop
floatdrop / gulpfile.js
Last active January 6, 2021 23:22
gulp.src - working with multiple source in one task
// npm i gulp event-stream
var gulp = require('gulp');
var es = require('event-stream');
gulp.task('test', function(cb) {
return es.concat(
gulp.src('bootstrap/js/*.js')
.pipe(gulp.dest('public/bootstrap')),
gulp.src('jquery.cookie/jquery.cookie.js')
const fileHash = crypto.createHash('md5').update(fileContents).digest('hex');
@antonjb
antonjb / layers_export.jsx
Created December 10, 2012 06:47
Illustrator Layer to SVG Exporter
/*
* Layers to SVG - layers_export.jsx
* @version 0.1
* Improved PageItem selection, which fixed centering
*
* @author Anton Ball
* Exports all layers to SVG Files
* I didn't want every layer in the SVG file so it first creates a new document
* and one by one copies each layer to that new document while exporting it out
* as an SVG.
@mattboon
mattboon / webfont-localstorage.js
Last active June 26, 2016 02:09
webfont-localstorage.js
function supportsWoff2() {
"use strict";
/*global FontFace*/
// Source: https://github.com/filamentgroup/woff2-feature-test
if (!window.FontFace) {
return false;
} else {
var f = new FontFace('t', 'url("data:application/font-woff2,") format("woff2")', {});
f.load();
return f.status === 'loading';
@nikoskip
nikoskip / gist:2336cde7ec864a5ffcb9
Created August 13, 2014 19:18
Obtener tamaño contenedor final de acuerdo a items con distintas medidas
<?php
/**
* Útil cuando se necesita calcular el tamaño de un paquete a enviar en el cual
* dentro van N productos con distintas medidas.
*
* Con este algoritmo se puede obtener el tamaño de la caja contenedora final necesaria.
*/
$dimensiones = array(0, 0, 0); // Largo, alto, ancho