Skip to content

Instantly share code, notes, and snippets.

View patrickandre's full-sized avatar

Patrick patrickandre

  • NYC
View GitHub Profile

Lab

Create a Rails app called fanzine. This app will have a controller called home and four routes called:

  • Homepage
  • Info
  • About
  • redirect_home

You'll have to match these routes with these templates:

@patrickandre
patrickandre / ga_lab_location.md
Last active May 16, 2017 14:05
ga_lab_location

Lab

Using the location Object, try the following:

  • Create a URL with the following schema: scheme:[//[user[:password]@]host[:port]][/path][?query][#fragment]
  • In a gist, identify all parts of a URL schema (With your own words)
  • Create a class with methods that extract and Identify all parts of the specified url Schema. For example, if https://www.example.com?foo=bar is provided, display the following on the page or console.
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title><%= title %></title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<style>
@import url(https://fonts.googleapis.com/css?family=Oswald:700|Quattrocento);
* {
const http = require('http');
const server = http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/html"});
response.write('<html>Hello World</html>');
response.end();
});
server.listen(5000);
console.log('Listening on port 5000');
/**
* Implement Foo Object.
* - Take a JSON object as an input parameter
* - Create a copy this JSON object as itself.
* - Chainable
*/
var foo = new Foo({
version : '1.0'
});
#!/usr/bin/env bash
# Helpful Aliases
alias ex="exit"
alias e="subl"
alias c="clear"
alias ls="ls -lh"
alias la="ls -lah"
alias pwd="pwd -LP"
config.init({
meta: {
title: 'Premier Dental Implant Practices',
name: "Christopher Webb",
homepage: 'http://conspirator.co',
twitter: 'conspirator',
banner: '/* \n' +
' * \tAuthor:\t\t{{meta.name}}\n' +
' * \tWebsite:\t{{meta.homepage}}\n' +
' * \tTwitter:\thttp://twitter.com/{{meta.twitter}}\n' +
@patrickandre
patrickandre / Grunt Here
Created October 28, 2012 16:36 — forked from conspirator/Grunt Here
The following AppleScript opens up Terminal, navigates to the path of the active Finder window, opens that directory in Sublime Text 2, and finally kicks off Grunt.js.
-- ========================================
-- Author: Christopher Webb
-- Web: http://conspirator.co
-- Twitter: http://twitter.com/conspirator
-- ========================================
set finderPath to ""
tell application "Finder"
try
@patrickandre
patrickandre / grunt.js
Created October 28, 2012 16:16 — forked from Takazudo/grunt.js
grunt.js example
var proc = require('child_process');
config.init({
lint: {
files : [ 'hoge.js', 'fuga.js' ]
},
concat: {
'all.js' : [ 'hoge.js', 'fuga.js', 'cofall.js', '_coftemp.js' ]
},
@patrickandre
patrickandre / qunit.md
Created October 12, 2012 14:40 — forked from peol/qunit.md
QUnit/SinonJS/Backbone.js

#Backbone.js Testing With QUnit & SinonJS

QUnit is a powerful JavaScript test suite written by Jörn Zaefferer and used by many large open-source projects (such as jQuery and Backbone.js) to test their code. It's both capable of testing standard JavaScript code in the browser as well as code on the server-side (where environments supported include Rhino, V8 and SpiderMonkey). This makes it a robust solution for a number of use-cases.

Quite a few Backbone.js contributors feel that QUnit is a better introductory framework for testing if you don't wish to start off with Jasmine and BDD right away. As we'll see later on in this chapter, QUnit can also be combined with third-party solutions such as SinonJS to produce an even more powerful testing solution supporting spies and mocks, which some say is preferable over Jasmine.

My personal recommendation is that it's worth comparing both frameworks and opting for the solution that you feel the most comfortable with.