Skip to content

Instantly share code, notes, and snippets.

@secretgspot
secretgspot / Contract Killer 3.md
Created January 15, 2018 07:26
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@secretgspot
secretgspot / Three Wise Monkeys.md
Created December 31, 2018 01:17
Three Wise Monkeys (NDA)

Date: [date]

Between us [company name] and you [customer name].

Summary:

In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

@secretgspot
secretgspot / banner_template.txt
Created December 31, 2018 02:00
Banner Template
.-----------------------------------------------------------------.
/ .-. .-. \
| / \ / \ |
| |\_. | | /| |
|\| | /| |\ | |/|
| `---' | | `---' |
| | | |
| |-----------------------------------------------------| |
\ | | /
\ / \ /
@secretgspot
secretgspot / geosyl.js
Created December 31, 2018 04:09 — forked from aemkei/geosyl.js
Geosyl.js – Convert Latitude longitude Pairs to Readable Words
// Geosyl.js – Convert Latitude longitude Pairs to Readable Words.
// based on David Troy's https://github.com/davetroy/hash-js
// also see: http://www.movable-type.co.uk/scripts/hash.html
// Distributed under the MIT License
geosyl = (function(){
var bits = [32, 16, 8, 4, 2, 1],
vocals = 'aeiou'.split(''),
consonants = 'kgsztdnhfpmyr'.split(''),
@secretgspot
secretgspot / likes.js
Last active September 26, 2019 05:42
let names = ['billy', 'jill', 'peter', 'john', 'richard'];
function likes(names) {
return {
0: 'no one likes this',
1: `${names[0]} likes this`,
2: `${names[0]} and ${names[1]} like this`,
3: `${names[0]}, ${names[1]} and ${names[2]} like this`,
4: `${names[0]}, ${names[1]} and ${names.length - 2} others like this`,
}[Math.min(4, names.length)]
}
let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 3, 4, 5, 7, 7];
// SHORTCUTS
const $ = (s) => document.querySelector(s);
const $$ = (s) => document.querySelectorAll(s);
const $$$ = (a) => Array.from(a);
$('#loader').classList.add('loading'); // single class selection
const responses = $$$(toggleResponsesButton.parentNode.querySelectorAll('.responses > .commentaire')); // create an array from node elements
// Find screen resolution based on ratio
function findScreenHeight(width, ratio) {
const [widthRatio, heightRatio] = ratio.split(':')
const height = width / widthRatio * heightRatio
return width + 'x' + height
}
findScreenHeight(1280,"16:9"); // '1280x720'
@secretgspot
secretgspot / filterArray.js
Created September 28, 2019 06:59 — forked from jherax/arrayFilterFactory.1.ts
Filters an array of objects with multiple match-criteria.
/**
* Filters an array of objects by custom predicates.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria
* @return {Array}
*/
function filterArray(array, filters) {
const filterKeys = Object.keys(filters);
return array.filter(item => {
/*
.__..__ . ..__
[__][__)|\/|| \
| || \| ||__/
ARMD its Add, Read, Modify, Delete
*/
const users = [
{
id: 1,
______ _____ ____ ______ ______
| .~ ~. .-~ ~. | ~. .~ ~. .~ ~. | ..''
| | | : |____.'_ | | | | |..''
| | | : _____ | ~. | | | | |``..
|_______ `.______.' `-._____.'| |_______.' `.______.' `.______.' | ``..
PORT OF LOGTEN PRO
AEROTOUR Aviation LOGBOOK
This application is an attempt to port Aviation Logbook to web interface.