Skip to content

Instantly share code, notes, and snippets.

Contract Killer 3

Revised date: 07/11/2012

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

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@jacopotarantino
jacopotarantino / image-texter.js
Created October 8, 2015 01:58
Script to quickly append arbitrary text to an arbitrary image, create a new image out of it, and download the new image.
;(function () {
'use strict'
// *** manipulating an image in the browser ***
var file_input, file_reader, image_data, canvas, text_input, converted_canvas_data
// user visits page
console.log('hello and welcome to the quote image generator')
// user sees a text input
text_input = document.createElement('input')
@jacopotarantino
jacopotarantino / twerkify.js
Created October 12, 2015 14:59
Twerkify - Make your website twerk.
(function () {
'use strict'
/**
* @module Twerkify
* @description Thank you for twerking. Use at your own risk.
*/
console.log('Thank you for twerking')
var json_request
@jacopotarantino
jacopotarantino / notes.md
Created November 5, 2015 15:34
article notes
  • link to a definition with minaswan(good for SEO and readability)
  • be careful about conflating ruby and rails(it's basically the same thing in use but not techincally the same project so just be careful about phrasing)
  • 2nd to last paragraph: i would focus on how machines today are powerful enough that we can spare a few cycles here and there instead of on the scale of modern webapps.
  • i'd like to see an example of what rails makes super simple/what's opinionated about it
  • i'd also like to see numbers on speed but that might not be the focus of this article
  • https://c1.staticflickr.com/1/7/8013829_1eaef1f51f.jpg
@jacopotarantino
jacopotarantino / spec.md
Created November 6, 2015 15:07
ajax challenge

I need for you to build the front end to our new user management system. The first component in this system is a dashboard that lists all of our current users.

Criteria:

  • This site is going to be run as strictly static pages that interact with APIs so no backend is necessary.
  • The API isn't available yet so you'll need to fake some data. Use randomuser.me to get a set of users.
  • Use jQuery to facilitate browser abstraction.
  • Fetch a set of 3 male users and list them on the page.
  • Put their avatar on the left and their name, username, and email address on the right.
@jacopotarantino
jacopotarantino / notes.md
Last active November 10, 2015 16:17
js notes
  • check out feross/standard for some javascript style advice and a plugin to autocorrect violations
  • never be afraid to write variables with long fuckall names. readability is more important than shorthand
  • always wrap code in an IIFE to prevent global namespace pollution
  • good job on the wordSubstituter method
  • bulkShortener: i'd prefer a map/forEach to a for loop
  • if this were in my codebase i'd make you write inline documentation but that's fine here
  • triple extra bonus points if you rewrote this in a more class-based manner like:
class Tweet {
@jacopotarantino
jacopotarantino / deploy-to-surge.sh
Created November 12, 2015 21:58
quick deploy an angular app to surge
#! /bin/bash
# test script to install and deploy a test application to surge.sh
# make sure node is up to date
brew update
brew upgrade node
# install node-based dependencies
npm install -g grunt-cli bower yo generator-karma generator-angular surge
@jacopotarantino
jacopotarantino / search.sh
Created November 21, 2015 17:44
Looping over files to find a particular line in those files
#! /bin/bash
# @description outputs lines and the files they came from to an arbitrary file
# @argument input {String} - regex looking for files in local directory
# @argument output {Filename} - where to echo found lines to
# @argument searchstring {String} - what to match for
# @example - ./search.sh '*.csv' outputfile.csv portuguese
echo $1
for file in $1; do
echo "Examining $file"
@jacopotarantino
jacopotarantino / phone-formatter.js
Created January 5, 2016 20:41
Formats phone number inputs
(function () {
$('#format-me').on('keydown', function (event) {
var text = event.target.value
var regex = /^\(\d{3}\)\s\d{3}-\d{4}$/
// if it's valid do nothing
if (regex.test(text)) { return }
// strip the input down to numbers only
text = text.replace(/\D/g, '')
@jacopotarantino
jacopotarantino / broken-image.html
Last active January 22, 2016 16:39
Make broken images not suck.
<script>
(() => {
'use strict'
let styles = `
.pretty-broken-image {
visibility: hidden;
position: relative;
}