Skip to content

Instantly share code, notes, and snippets.

@mkhazov
mkhazov / WilsonConfidenceIntervalCalculator.php
Created May 19, 2019 17:47 — forked from mbadolato/WilsonConfidenceIntervalCalculator.php
PHP translation of the Wilson ConfidenceInterval Calculator. Ported from Ruby and uses a hardcoded (pre-calculated) confidence (z value) instead of a dynamic calculation with a translation of Ruby's Statistics2.pnormaldist method. Since z doesn't change once it's computed, nor is the computation dependant on the passed-in values, calculating it …
<?php
/*
* (c) Mark Badolato <mbadolato@gmail.com>
*
* This content is released under the {@link http://www.opensource.org/licenses/MIT MIT License.}
*/
namespace Bado;
@mkhazov
mkhazov / rules-delimiter.js
Last active July 22, 2016 22:43 — forked from thebugs/rules-delimiter.js
rules-delimiter option for csscomb.js. Works with 3.1.8
module.exports = {
name: 'rules-delimiter',
syntax: ['scss'],
runBefore: 'strip-spaces',
setValue: function(value) {
if (typeof value === 'number') {
value = Array(value + 2).join('\n');
@mkhazov
mkhazov / group-size.js
Last active July 22, 2016 22:44
group-size option for csscomb.js. Works with csscomb.js 3.1.8
module.exports = {
name: 'group-size',
runBefore: 'tab-size',
syntax: ['css', 'scss', 'less'],
setValue: function(value) {
if (typeof value !== 'number') throw new Error('The option accepts only numbers');
return Math.floor(value);
@mkhazov
mkhazov / post-receive
Created July 10, 2015 23:25
Automate Deployment with git post-receive hook
#!/bin/bash
while read oldrev newrev ref
do
if [[ $ref =~ .*/master$ ]];
then
echo "Master ref received. Deploying master branch to production..."
git --work-tree=/path/to/production --git-dir=/path/to/git checkout -f
else
echo "Ref $ref successfully received. Doing nothing: only the master branch may be deployed on this server."
fi
diff --git a/additional-providers/hybridauth-odnoklassniki/Providers/Odnoklassniki.php b/additional-providers/hybridauth-odnoklassniki/Providers/Odnoklassniki.php
index ee8bc24..1474d91 100644
--- a/additional-providers/hybridauth-odnoklassniki/Providers/Odnoklassniki.php
+++ b/additional-providers/hybridauth-odnoklassniki/Providers/Odnoklassniki.php
@@ -31,7 +31,7 @@ class Hybrid_Providers_Odnoklassniki extends Hybrid_Provider_Model_OAuth2
Hybrid_Logger::debug( "OAuth2Client::request(). dump request params: ", serialize( $params ) );
if( $type == "GET" ){
- $url = $url . ( strpos( $url, '?' ) ? '&' : '?' ) . http_build_query( $params );
+ $url = $url . ( strpos( $url, '?' ) ? '&' : '?' ) . http_build_query($params, '', '&');