Skip to content

Instantly share code, notes, and snippets.

Avatar

Johnny Sparks johnnysparks

View GitHub Profile
@johnnysparks
johnnysparks / lint.json
Last active Apr 17, 2019
NoReturnVoidRule
View lint.json
{
"key.elements" : [
{
"key.kind" : "source.lang.swift.structure.elem.condition_expr",
"key.length" : 13,
"key.offset" : 102
}
],
"key.kind" : "source.lang.swift.stmt.guard",
"key.length" : 83,
View TestFlight.podspec
Pod::Spec.new do |s|
s.name = 'TestFlightSDK'
s.version = '1.1b3'
s.license = 'Commercial'
s.summary = 'TestFlightSDK for over-the-air beta testing and crash reporting.'
s.homepage = 'http://www.testflightapp.com'
s.author = { 'TestFlight' => 'support@testflightapp.com' }
s.source = { :http => 'https://d3fqheiq7nlyrx.cloudfront.net/sdk-downloads/TestFlightSDK1.1beta3.zip' }
s.description = 'TestFlightSDK for over-the-air beta testing and crash reporting.'
s.platform = :ios
@johnnysparks
johnnysparks / radio_button_styled.css
Created May 1, 2013
Styles for the custom radio button form.
View radio_button_styled.css
#styled input {
display: none;
}
#styled label {
display: inline-block;
}
#styled label p{
text-align: center;
}
#styled input + label > img{
@johnnysparks
johnnysparks / radio_button_form.html
Created May 1, 2013
Markup for custom radio buttons.
View radio_button_form.html
<form id="styled">
<input type="radio" name="emotion" id="happy" />
<label for="happy">
<img alt="happy" src="http://i.imgur.com/zm8fp.png" />
<p>happy</p>
</label>
<input type="radio" name="emotion" id="sad" />
<label for="sad">
<img alt="sad" src="http://i.imgur.com/sKhy9.png" />
<p>sad</p>
@johnnysparks
johnnysparks / UserSeeder.rb
Last active Dec 16, 2015
Steam Profile Name Scrapper
View UserSeeder.rb
require 'open-uri'
require 'nokogiri'
require 'cgi'
# UserSeeder class has one important method -> get_user
# all forum and discussion pagination should be automagic
class UserSeeder
def initialize
@forum = -1 # only access to new forum page increments before fetching, staring at -1
@user_buffer = [] # user buffer holds the list of profile names
@johnnysparks
johnnysparks / UserGameScrape.rb
Created Apr 13, 2013
One-off script for grabbing a users steam games and hours played.
View UserGameScrape.rb
require 'open-uri'
require 'nokogiri'
require 'cgi'
require 'json'
# UserGameScrape
#
# Usage:
# ugs = UserGameScrape.new
# games_tsv_string = ugs.games( steam_game_name )
View johnnyfuchs.txt
1 208480 480.5 Assassins Creed III
2 72850 279.7 The Elder Scrolls V: Skyrim
3 205100 273.1 Dishonored
4 35140 208.2 Batman: Arkham Asylum GOTY Edition
5 217790 71.5 Dogfight 1942
6 8930 36.7 Sid Meiers Civilization V
7 24780 36.6 SimCity 4 Deluxe
8 620 17.2 Portal 2
9 400 15.3 Portal
10 41500 8.8 Torchlight
@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
@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 / 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",