Skip to content

Instantly share code, notes, and snippets.

View rwisner's full-sized avatar
👋
Hello World

Rob Wisner rwisner

👋
Hello World
  • Star Publishing
  • Tucson, AZ
View GitHub Profile
@nicked
nicked / makepass.php
Created June 13, 2012 08:30
A PHP script for packaging up an iOS 6 Passbook file
<?
DEFINE('BASE_PATH', '.');
//relative to where you are running this script from. All paths below are relative to this
DEFINE('P12_FILE', 'My Certificate.p12');
//your Pass Certificate, exported from Keychain Access as a P12 file
DEFINE('P12_PASSWORD', '');
//if you exported your P12 with a password, enter it here
//
// TopAlignedFlowLayout.swift
//
// Copyright © 2015 Sean Kasun
//
// Add TopAlignedFlowLayout.swift to your project, then in your storyboard,
// change the Collection View's Layout to "Custom" and set the Class
// to "TopAlignedFlowLayout". Boom.
import Foundation
@rlynjb
rlynjb / ga.go
Last active August 14, 2018 02:08
code sample for Google API oauth using GoLang
// Hello, hope you find this code useful
package main
import (
// this is a deprecated oauth lib from godoc.org
// i was going to use the new one (https://godoc.org/golang.org/x/oauth2/google)
// but due to a bug i've found and filed at github
// i decided to revert to the old one instead until the new one is stable
"code.google.com/p/goauth2/oauth/jwt"
"encoding/json"
@vinczebalazs
vinczebalazs / UIColor+NamedColors.swift
Last active April 13, 2020 05:34
UIColor+NamedColors
extension UIColor {
static var accent: UIColor {
UIColor(named: "Accent")!
}
static var primary: UIColor {
UIColor(named: "Primary")!
}
static var primaryText: UIColor {
@kwmt
kwmt / Castle.xml
Last active November 9, 2021 01:16 — forked from bemasher/Castle.xml
<?xml version="1.0" encoding="UTF-8" ?>
<Data>
<Series>
<id>83462</id>
<Actors>|Nathan Fillion|Stana Katic|Molly C. Quinn|Jon Huertas|Seamus Dever|Tamala Jones|Susan Sullivan|Ruben Santiago-Hudson|Monet Mazur|</Actors>
<Airs_DayOfWeek>Monday</Airs_DayOfWeek>
<Airs_Time>10:00 PM</Airs_Time>
<ContentRating>TV-PG</ContentRating>
<FirstAired>2009-03-09</FirstAired>
<Genre>|Drama|</Genre>
@SabretWoW
SabretWoW / json_response_handling_ruby.rb
Created December 11, 2013 14:20
Ruby script that uses open-uri to fetch the contents of a JSON endpoint, uses the JSON gem to parse the string into a Ruby array & prints some of the records. This is the foundation for all web API requests, so feel free to use it in the future.
# http://ruby-doc.org/stdlib-2.0.0/libdoc/open-uri/rdoc/OpenURI.html
require 'open-uri'
# https://github.com/flori/json
require 'json'
# http://stackoverflow.com/questions/9008847/what-is-difference-between-p-and-pp
require 'pp'
# Construct the URL we'll be calling
request_uri = 'http://localhost:3000/users.json'
request_query = ''
@robinwarren
robinwarren / dashboard.html
Last active January 28, 2022 17:15
Trello dashboard using Bootstrap and JQuery
<html>
<head>
<title>A Trello Dashboard</title>
<link rel="stylesheet" media="screen" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1>Trello Dashboard</h1>
<form class="form-horizontal" id="boards_form">
@alexstone
alexstone / slack_notification.php
Created March 3, 2014 06:54
Fire a Slack Notification via CURL
<?php
// (string) $message - message to be passed to Slack
// (string) $room - room in which to write the message, too
// (string) $icon - You can set up custom emoji icons to use with each message
public static function slack($message, $room = "engineering", $icon = ":longbox:") {
$room = ($room) ? $room : "engineering";
$data = "payload=" . json_encode(array(
"channel" => "#{$room}",
"text" => $message,
import sys
import subprocess
import tempfile
import urllib
text = sys.stdin.read()
chart_url_template = ('http://chart.apis.google.com/chart?'
'cht=qr&chs=300x300&chl={data}&chld=H|0')
chart_url = chart_url_template.format(data=urllib.quote(text))
@valvoline
valvoline / String+HTML.swift
Created November 8, 2017 18:31
A swift string extension to deal with HTML
//
// String+HTML.swift
// AttributedString
//
// Created by Costantino Pistagna on 08/11/2017.
// Copyright © 2017 sofapps.it All rights reserved.
//
import UIKit
import Foundation