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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-s | |
RewriteRule ^(.*)$ rest/index.php?_rest=$1 [QSA,NC,L] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^(.*)$ rest/index.php [QSA,NC,L] | |
</IfModule> |
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 | |
if (!$modx->user->hasSessionContext($modx->context->get('key')) return ''; | |
$userArray = $modx->user->toArray(); | |
$profile = $modx->user->getOne('Profile'); | |
if ($profile) { | |
$userArray = array_merge($profile->toArray(),$userArray); | |
$extended = $profile->get('extended'); | |
if (!empty($extended) && is_array($extended)) { |
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
$config = array( | |
'baseUrl' => rtrim('http://mywebsite.com/rest/api/','/'), | |
'format' => 'json', // json or xml, the format to request | |
'suppressSuffix' => false, // if false, will append .json or .xml to the URI requested | |
'username' => 'myuser', // if set, will use cURL auth to authenticate user | |
'password' => 'mypass', | |
'curlOptions' => array( | |
'timeout' => 30, // cURL timeout | |
'otherCurlOption' => 1, |
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
Things Nick Hates | |
0) Ann Kitchen | |
1) non-shallow tests | |
2) `if !` | |
3) ants | |
4) rock stars | |
5) sunlight off porch windows when drinking coffee | |
6) people who feed the meter | |
7) using floats for money |
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
syntax = "proto3"; | |
package demo; | |
service Jobs { | |
rpc GetJob(GetJobReq) returns (GetJobResp) { } | |
} | |
message GetJobReq { | |
uint64 id = 1; |
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
<li>[[+username]]</li> |
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
Examples of above script: | |
# into a standard directory, where config.xml resides in the current working directory | |
sh install.sh /home/modx/public_html/ | |
# with a custom config.xml file | |
sh install.sh /home/modx/public_html/ /opt/local/modx/config.xml |
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
<?xml version="1.0" encoding="utf-8"?> | |
<interface-response> | |
<CertGetApproverEMail> | |
<Success>False</Success> | |
</CertGetApproverEMail> | |
<Command>CERTGETAPPROVEREMAIL</Command> | |
<APIType>API</APIType> | |
<Language>eng</Language> | |
<ErrCount>1</ErrCount> | |
<errors> |
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
## | |
# Finds a normalized ranking of word frequency given an article of text | |
# | |
class Hash | |
## | |
# Normalize the array to values between 0 and 1 | |
# | |
# @param [Boolean] weight_lower_value Set to true to give more weight to lower values | |
# | |
def normalize(weight_lower_value = false) |
NewerOlder