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
import Data.List(group) | |
import Control.Arrow | |
solve = concatMap (uncurry (:) . (head &&& show . length)) . group |
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
import Data.List | |
import Control.Arrow | |
-- "aaabbbbcc" | |
-- ["aaa", "bbbb", "cc"] | |
f1 :: String -> [String] | |
f1 str = group str | |
-- "aaa" | |
-- -> ("a", "3") |
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
<EntityDescriptor entityID="https://idp.example.com/idp/shibboleth"> | |
<IDPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:1.1:protocol urn:mace:shibboleth:1.0 urn:oasis:names:tc:SAML:2.0:protocol"> | |
<Extensions> | |
<shibmd:Scope regexp="false" xmlns:shibmd="urn:mace:shibboleth:metadata:1.0">idp.example.com</shibmd:Scope> | |
<mdui:UIInfo xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui"> | |
<mdui:DisplayName xml:lang="ja">idp-example</mdui:DisplayName> | |
<mdui:DisplayName xml:lang="en">idp-example Inc.</mdui:DisplayName> | |
<mdui:Logo height="75" width="200">http://www.idp-example.co.jp/images/logo.png</mdui:Logo> | |
<mdui:InformationURL xml:lang="ja">http://www.idp-example.co.jp/</mdui:InformationURL> | |
<mdui:InformationURL xml:lang="en">http://www.idp-example.co.jp/</mdui:InformationURL> |
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
$metadata['https://idp.example.com/idp/shibboleth'] = array ( | |
'name' => 'ssp_flat', | |
'metadata-set' => 'saml20-idp-remote', | |
'entityid' => 'https://idp.example.com/idp/shibboleth', | |
'SingleSignOnService' => array ( | |
0 => | |
array ( | |
'Binding' => 'urn:mace:shibboleth:1.0:profiles:AuthnRequest', | |
'Location' => 'https://idp.example.com/idp/profile/Shibboleth/SSO', | |
), |
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
# -*- coding: iso-8859-1 -*- | |
# IMPORTANT! This encoding (charset) setting MUST be correct! If you live in a | |
# western country and you don't know that you use utf-8, you probably want to | |
# use iso-8859-1 (or some other iso charset). If you use utf-8 (a Unicode | |
# encoding) you MUST use: coding: utf-8 | |
# That setting must match the encoding your editor uses when you modify the | |
# settings below. If it does not, special non-ASCII chars will be wrong. | |
""" | |
MoinMoin - Configuration for a single wiki |
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
name = None | |
given = saml_attributes.get('givenName', None) | |
family = saml_attributes.get('sn', None) | |
if given and family: | |
# custom flow by me. | |
# If both given and family names are available, combine them | |
# into one and treat it as a MoinMoin candidate | |
logging.debug('Found both given and family names') | |
candidate = (given[0] + family[0]).replace(' ', '') | |
if user.isValidName(request, candidate): |
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
<html> | |
<head> | |
<title>Encryption test..</title> | |
</head> | |
<body> | |
<?php | |
// $textToEncrypt = "My super secret information."; |
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
extern "C" int ADFS_EXPORTS xmltooling_extension_init(void*) | |
{ | |
SPConfig& conf=SPConfig::getConfig(); | |
conf.SessionInitiatorManager.registerFactory("ADFS", ADFSSessionInitiatorFactory); | |
conf.LogoutInitiatorManager.registerFactory("ADFS", ADFSLogoutInitiatorFactory); | |
conf.AssertionConsumerServiceManager.registerFactory("ADFS", ADFSLogoutFactory); | |
conf.AssertionConsumerServiceManager.registerFactory(WSFED_NS, ADFSLogoutFactory); | |
#ifndef SHIBSP_LITE | |
SAMLConfig::getConfig().MessageDecoderManager.registerFactory(WSFED_NS, ADFSDecoderFactory); | |
XMLObjectBuilder::registerBuilder(xmltooling::QName(WSTRUST_NS,"RequestedSecurityToken"), new AnyElementBuilder()); |
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
// Almost based on | |
// https://bitbucket.org/bumble/bumble-golang-common/src/master/key/ | |
package main | |
import "crypto/rsa" | |
import "crypto/rand" | |
import "crypto/x509" | |
import "encoding/pem" | |
import "fmt" |
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
package main | |
import ( | |
"code.google.com/p/go-tour/wc" | |
"strings" | |
) | |
func WordCount(s string) map[string]int { | |
m := make(map[string]int) | |
for _, val := range strings.Fields(s) { |
OlderNewer