Skip to content

Instantly share code, notes, and snippets.

View code-for-coffee's full-sized avatar

James code-for-coffee

  • Chicago, IL
View GitHub Profile
@code-for-coffee
code-for-coffee / zonefile
Created November 2, 2016 20:46
Github Pages DNS Zonefile
@ 1800 IN A 192.30.252.153
@ 1800 IN A 192.30.252.154
www 1800 IN CNAME code-for-coffee.github.io.
@code-for-coffee
code-for-coffee / 01_intro_workshop.md
Last active November 2, 2016 19:43
ASP.NET MVC Workshop

Outline

  • Follow similar format to C&W
  • Introduction workshop, aimed at jr+ developers, hiring managers, technical trainers
  • 2 hour length

Goals

  • Introduce the MVC design pattern
  • Modify C# code to implement features in an app
@code-for-coffee
code-for-coffee / libs_and_styles.md
Last active November 2, 2016 19:29
Library & Style Guide

Unit 1 - Client Side

  • Javascript (ES5) & jQuery
    • DOM manipulation
    • Control flow & logic
    • Data types & structures (Arrays, Objects)
    • Functions & scope
    • Constructors
  • HTML5
  • Semantic Tags
@code-for-coffee
code-for-coffee / img.html
Created November 2, 2016 16:12
Base64 Rendering IMG
<img src='
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4QONaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzExMSA3OS4xNTgzMjUsIDIwMTUvMDkvMTAtMDE6MTA6MjAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6NGZhNTIwOTItOWY4Yi0wNDQ2LWE1NGMtYTk1ZjgzOWRmNzQ3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkJGQkNDRTEyNjg1NzExRTY4QTQ1OTA2OUNFRThFQjU0IiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkJGQkNDRTExNjg1NzExRTY4QTQ1OTA2OUNFRThFQjU0IiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1IChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPS
@code-for-coffee
code-for-coffee / db.js
Last active December 20, 2016 19:26
MySQL Node
/**
* Created by codeforcoffee on 10/13/16.
*/
var knex = require('knex')({
client: 'mysql',
connection: {
host : 'localhost',
user : 'l33tdba',
password : 'w0rk5pac3',
database : 'first_run'
  1. What is the difference between an ID and class?
  2. If I have a function represented as f and an argument of an [], how could I return the argument in reverse order?
  3. Describe what the document object represents & may do.
  4. How could you loop through an Object's properties to see if it contains ['results']?
  5. f([]) has an argument of []; [].length is n. f([]) returns undefined. Describe what you know about f
@code-for-coffee
code-for-coffee / mon_reps_obj.md
Created September 26, 2016 16:12
Object Reps

Object Reps

You will create three Objects.

Pet

  • Create an {} called pet. Assign it 4 attributes.
  • Using dot notation and obj['key'] syntax, console.log() each attribute.

Bike

@code-for-coffee
code-for-coffee / mon_reps_obj.md
Created September 26, 2016 16:12
Object Reps

Object Reps

You will create three Objects.

Pet

  • Create an {} called pet. Assign it 4 attributes.
  • Using dot notation and obj['key'] syntax, console.log() each attribute.

Bike

@code-for-coffee
code-for-coffee / scraper.py
Last active May 23, 2018 10:00
Python Webscrape Example
import scrapy
import bs4
from scrapy.selector import HtmlXPathSelector
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import Rule
import os, nltk, pandas as pd, numpy as np, bs4, urllib, re, robobrowser, requests, csv, collections, scrapy
from bs4 import BeautifulSoup, NavigableString, SoupStrainer
@code-for-coffee
code-for-coffee / linux-debian.sh
Last active October 4, 2016 15:17
Python Awesomeness
#install python 2.7.x
apt-get install python
#install pip
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py
# install beautiful soup
pip install beautifulsoup4
pip install robobrowser
pip install scrapy