This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load Json into a Python object | |
import urllib2 | |
import json | |
req = urllib2.Request("http://localhost:81/sensors/temperature.json") | |
opener = urllib2.build_opener() | |
f = opener.open(req) | |
json = json.loads(f.read()) | |
print json | |
print json['unit'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Fluent: | |
def __init__(self, cache=None): | |
self._cache = cache or [] | |
# Build the cache, and handle special cases | |
def _(self, name): | |
# Enables method chaining | |
return Fluent(self._cache+[name]) | |
# Final method call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#set -x | |
# Usage: shibb-cas-get.sh {username} {password} # If you have any errors try removing the redirects to get more information | |
# The service to be called, and a url-encoded version (the url encoding isn't perfect, if you're encoding complex stuff you may wish to replace with a different method) | |
DEST=https://myapp.example.com/ | |
SP=https://myapp.example.com/index.php | |
IDP="https://myidp.example.com/idp/shibboleth&btn_sso=SSOok" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ksh | |
################################################################################# | |
# | |
# CURL snippet to do commands on SSO (Siteminder etc) protected systems | |
# This script will set cookies in one server | |
# Copies the cookie information into another server | |
# Imports the cookie information to maintain seemless CURL commands | |
# | |
################################################################################# | |
page_name="ABC_Test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Who should drive?</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!-- Styles --> | |
<style type="text/css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Specify System Administrator credentials | |
# that will login to Salesforce to retrieve the metadata. | |
# | |
# You will also need the security token. | |
# | |
# The server url is which instance to connect to: | |
# For sandboxes, use https://test.salesforce.com | |
# For production or developer orgs, use https://login.salesforce.com | |
# |