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
<?php | |
class sspmod_saml_Auth_Source_SP extends SimpleSAML_Auth_Source { | |
/** | |
* The entity ID of this SP. | |
* | |
* @var string | |
*/ | |
private $entityId; |
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
<?php | |
class FrozenSso { | |
protected $plugin_slug = 'frzn-sso'; | |
protected $auth_secret = 'super secret string :)'; | |
protected static $instance = null; | |
protected $plugin_screen_hook_suffix = 'FrozenSso'; | |
private function __construct() { | |
if ( NULL <> $this->auth_secret && !defined( 'FRZN_SSO_SECRET' ) ) |
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
var mapping = 'foo.bar'; | |
var raw = eval('record.raw.' + mapping); |
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
It seems that mobgifts is taking over sites when you browse to them with an android phone. I've tracked down the problem to ads served up via the adnxs.com and trafficserv.info domains. | |
To determine this I did the following on my desktop: | |
* configured Chrome to use an andriod user agent | |
** Mozilla/5.0 (Linux; U; Android 2.3.6; en-us; Nexus S Build/GRK39F) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 | |
* opened the inspector and set the net panel to persist. | |
* requested a page known to have the problem | |
* exported the contents of the net tab to a HTTP Archive json | |
* wrote a script (below) to rerun the requests and dump out the contents |
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
/* | |
In http://dropshado.ws/post/17210606192/varry-var-var Dave DeSandro declares that he is going to go to 1 var per variable. His reasons inclue: | |
* Easier to add more variables, no need to change any trailing comma or semi-colon. | |
* Eliminates unnecessary git commit diffs, where a line has changed only because you changed a trailing semi-colon or comma. | |
* Easier to read (IMO). var is a reserved keyword, so it jumps out when syntax highlighted. | |
* Eliminates awkward tab spacing underneath the var. It only lines up if your tabs are 4 spaces wide. | |
* [Per JFSIII] Helps collaboration, other devs might miss the change of semi-colon and accidentally add a global variable. | |
The following format resolves 3 of the 5 issues (but everyone knows that real JS is written using spaces not tabs. |
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
$('body').delegate("*", "click", function(e){ | |
console.log( 'here' , e.target); | |
}); | |
$("*").click(function(e){ | |
console.log( 'there', e.target ); | |
}); | |
$('body').delegate("click", "*", function(e){ | |
console.log( 'HUH?!?!?' , e.target); | |
}); |
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
#This should work for most cases, at least on OSX | |
def open_encoded file_name, &block | |
fcheck = `file --mime #{file_name}` | |
charset = fcheck.split(/charset=/).last.gsub(/\s+/, ' ').strip | |
if ["unknown-8bit", "iso-8859-1"].include?(charset) | |
encoding = Encoding::Windows_1250 #This is a guess. In the case of the files I'm working with, this is true. YMMV | |
else | |
begin | |
encoding = Encoding.find(charset) |
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
/Site1_Dev | |
/Site1_Stage | |
/Site1_Web | |
/Site1_Assets | |
/Site1_Uninteresting_Folder | |
/Site1_Other_Uninteresting_Folder | |
/Site2_Dev | |
/Site2_Stage | |
/Site2_Web |
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
var mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/my_database'); | |
var Schema = mongoose.Schema | |
, ObjectId = Schema.ObjectId; | |
var BlogPost = new Schema({ | |
author : ObjectId | |
, title : String |
NewerOlder