Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am awaxman11 on github.
* I am awaxman11 (https://keybase.io/awaxman11) on keybase.
* I have a public key ASDKDLij24fvD4Tv7xJ9NQip1Jvwqa7fY7iL3jpZ2I1GpAo
To claim this, I am signing this object:
@ajwaxman
ajwaxman / MediaItem.swift
Created January 12, 2016 14:14
Updated Twitter Package - CS193p Lecture 10 - Updated for Swift 2.0 and Xcode 7.2
//
// MediaItem.swift
// Twitter
//
// Created by CS193p Instructor.
// Copyright (c) 2015 Stanford University. All rights reserved.
//
import Foundation
var githubIssueTitle = $('.js-issue-title').text().split(']').pop().trim();
var githubIssueNumber = $('.gh-header-number').text();
var sprintIssueTitle = githubIssueNumber + ": " + githubIssueTitle;
window.prompt('Press CTRL+C, then ENTER',sprintIssueTitle);
console.log("Does this work");
<div class="explore-view" ng-repeat="event in exploreEvents">
<div class="explore-cell-container">
<div class="photo" style="background-image: url(http://cdn.chairnerd.com/images/performers-landscape/america-8b6f8a/186/huge.jpg)"></div>
<div class="photo-overlay"></div>
<div class="heart"></div>
<div class="event-info">
<h2>Arcade Fire</h2>
<h5>Fri, Aug 22, 7:45PM - Barclays Center</h5>
</div>
</div>
/* Space out content a bit */
body {
}
h1, h2, h3, h4, h5, h6 {
font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-weight: 300;
color: #444;
}
@ajwaxman
ajwaxman / gist:6201837
Created August 10, 2013 19:36
jawbone auth
code = params["code"]
json = HTTParty.post("https://jawbone.com/auth/oauth2/token", body: {client_id: ENV["JAWBONE_CLIENT_ID"], client_secret: ENV["JAWBONE_CLIENT_SECRET"], grant_type: 'authorization_code', code: code }).body
result = JSON.parse(json)
access_token = "Bearer " + result["access_token"]
@user = HTTParty.get("https://jawbone.com/nudge/api/users/@me", :headers => { "Authorization" => access_token })["data"]
@ajwaxman
ajwaxman / gist:6132646
Created August 1, 2013 15:51
chrome extension js
console.log("Hello World");
var addHtml = {
addForm: function() {
var form = document.createElement('div');
form.innerHTML = '<form id="dynForm" action="http://example.com/" method="get"><input type="hidden" name="q" value="a"></form>';
document.body.appendChild(form);
document.getElementById("dynForm").submit();
}
@ajwaxman
ajwaxman / gist:6117447
Created July 30, 2013 22:02
hire crm scrapers
# Top Ruby Jobs
job_title = doc.css("#col-left h2")
company_title = doc.css("#col-left dd")[0].text
location = doc.css("#col-left dd")[1].text
description = doc.css(".description").text
# Team Treehouse
full_header = doc.css(".job-headline h1").text
company_header = doc.css(".job-headline h1 strong").text
@ajwaxman
ajwaxman / gist:6055337
Created July 22, 2013 16:34
ruby assessment
# AdamWaxman_assessment.rb
#############
# 1. Arrays #
#############
array = ["Blake", "Ashley", "Jeff"]
# a. Add a element to an array
@ajwaxman
ajwaxman / gist:5876691
Created June 27, 2013 14:05
phone-number
class Phone
attr_accessor :number
def initialize(number)
a = []
original = number.each_char {|x| a << x if x =~ /\d/ }
@number = a
if @number.length == 11 && @number[0] == "1"
@number = @number[1,10].join