Skip to content

Instantly share code, notes, and snippets.

View johnnysparks's full-sized avatar

Johnny Sparks johnnysparks

View GitHub Profile
@johnnysparks
johnnysparks / twitter_media.json
Created February 26, 2014 18:18
Twitter Media Data Structure
{
"media": [
{
"id": 438737600342290400,
"id_str": "438737600342290432",
"indices": [
99,
121
],
"media_url": "http: //pbs.twimg.com/media/Bha1heICcAAKEIY.jpg",
@johnnysparks
johnnysparks / twitter_search_res.json
Created February 26, 2014 19:17
Twitter Search Result Structure
{
"statuses": [
{
"metadata": {
"result_type": "recent",
"iso_language_code": "en"
},
"created_at": "Wed Feb 26 19:12:29 +0000 2014",
"id": 438753453880250400,
"id_str": "438753453880250368",
@johnnysparks
johnnysparks / twitter_retweet.json
Created February 26, 2014 19:24
Twitter Create Resource
{
"created_at": "Wed Feb 26 19:22:38 +0000 2014",
"id": 438756007276466200,
"id_str": "438756007276466176",
"text": "RT @lukeoneil47: Each California county's most distinctive soon-to-be-endangered crop @MotherJones http://t.co/UjYOcJgoDK",
"source": "<a href="https://apigee.com/console/twitter" rel="nofollow">Apigee's API Console</a>",
"truncated": false,
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
@johnnysparks
johnnysparks / twitter_list_many.json
Created February 26, 2014 19:25
Twitter resource list json structure
[
{
"code": "fr",
"status": "production",
"name": "French"
},
{
"code": "en",
"status": "production",
"name": "English"
#
# Uncrustify Configuration File
# File Created With UncrustifyX 0.2 (140)
#
# Alignment
# ---------
## Alignment
@johnnysparks
johnnysparks / globals.js
Created October 3, 2014 07:17
globals.js
function HeartButton(){
this.user = whi.currentUser();
this.entry = false;
}
HeartButton.prototype.renderIn = function($dom){
var $img = $dom.find('img');
this.entry = new whi.Entry();
this.entry.id = $img.data('entry');
@johnnysparks
johnnysparks / templMethods.js
Created May 10, 2012 15:29
Koi namespace / extend
/**
* Checkout bobbitt's base koi examples here:
* https://github.com/ericb/Koi/blob/master/examples.js
*/
// use koi namespace to define a new object level ( this is basically if !tmplMethods, tmplMethods = {} )
Koi.namespace('tmplMethods');
// if there are methods used across a section of the application, you could nest deeper ( common ajax calls or something )
@johnnysparks
johnnysparks / mongohq_ajax.html
Created May 14, 2012 03:00
Quick MongoHQ ajax demo
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
// post demo
$.ajax({
dataType: "json",
type: "post",
@johnnysparks
johnnysparks / search_row.html
Last active December 15, 2015 22:19
Steam Search Results Item
<a class="search_result_row even" href="http://store.steampowered.com/app/211160/?snr=1_7_7_230_150_24">
<div class="col search_price"> &#36;14.99 </div>
<div class="col search_type">
<img src="http://cdn2.store.steampowered.com/public/images/ico/ico_type_app.gif">
</div>
<div class="col search_metascore"></div>
<div class="col search_released"> Oct 17, 2012 </div>
<div class="col search_capsule">
<img src="http://cdn2.steampowered.com/v/gfx/apps/211160/capsule_sm_120.jpg?t=1350669009" alt="Buy Viking: Battle for Asgard" width="120" height="45">
</div>
@johnnysparks
johnnysparks / SteamGameScrape.rb
Last active December 15, 2015 22:29
Ruby class to collect list of steam game names.
require 'open-uri'
require 'nokogiri'
require 'cgi'
class SteamGameStrape
def initialize
@page = 1
@url = "http://store.steampowered.com/search/results"
@user_agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22"
@row = 0