Skip to content

Instantly share code, notes, and snippets.

Avatar

Johnny Sparks johnnysparks

View GitHub Profile
View twitter_retweet.json
{
"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 Feb 26, 2014
Twitter resource list json structure
View twitter_list_many.json
[
{
"code": "fr",
"status": "production",
"name": "French"
},
{
"code": "en",
"status": "production",
"name": "English"
@johnnysparks
johnnysparks / twitter_search_res.json
Created Feb 26, 2014
Twitter Search Result Structure
View twitter_search_res.json
{
"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_media.json
Created Feb 26, 2014
Twitter Media Data Structure
View twitter_media.json
{
"media": [
{
"id": 438737600342290400,
"id_str": "438737600342290432",
"indices": [
99,
121
],
"media_url": "http: //pbs.twimg.com/media/Bha1heICcAAKEIY.jpg",
View trr-objc.cfg
#
# Uncrustify Configuration File
# File Created With UncrustifyX 0.2 (140)
#
# Alignment
# ---------
## Alignment
View 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
Koi namespace / extend
View templMethods.js
/**
* 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
Quick MongoHQ ajax demo
View mongohq_ajax.html
<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 Dec 15, 2015
Steam Search Results Item
View search_row.html
<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 Dec 15, 2015
Ruby class to collect list of steam game names.
View SteamGameScrape.rb
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