Skip to content

Instantly share code, notes, and snippets.

View DreadfulCode's full-sized avatar
💭
Making It Happen

ƊŗęДdϝul Ȼʘɗɇ DreadfulCode

💭
Making It Happen
View GitHub Profile
@marians
marians / CouchDB_Python.md
Last active April 9, 2024 12:21
The missing Python couchdb tutorial

This is an unofficial manual for the couchdb Python module I wish I had had.

Installation

pip install couchdb

Importing the module

@hitbtc-com
hitbtc-com / hitbtc_example.php
Last active September 2, 2023 18:34
hitbtc php example
<?php
namespace Hitbtc;
/**
* show off @method
*
* @method string balance() balance( array $params )
* @method string ordersActive() ordersActive( array $params )
* @method string new_order() new_order( array $params )
* @method string cancel_order() cancel_order( array $params )
* @method string trades() trades( array $params )
@VladaHejda
VladaHejda / Phpunit-assert_exception.php
Last active December 28, 2022 03:59
Phpunit Exception assertion. For easy multiple testing if Exception is thrown in one test method. For PHP >= 5.5 you can use package with trait: https://packagist.org/packages/vladahejda/phpunit-assert-exception
<?php
abstract class TestCase extends \PHPUnit_Framework_TestCase
{
protected function assertException(callable $callback, $expectedException = 'Exception', $expectedCode = null, $expectedMessage = null)
{
$expectedException = ltrim((string) $expectedException, '\\');
if (!class_exists($expectedException) && !interface_exists($expectedException)) {
$this->fail(sprintf('An exception of type "%s" does not exist.', $expectedException));
}
@janv
janv / broken_promise.js
Last active May 6, 2023 03:55
A sad poem, written in Javascript
// Replacing callbacks with scumbacks
// Promises to call you back but then doesn't
// Getting your hopes up again
// and again
var brokenPromise = {
then: doesnt
};
function doesnt(callback){
return brokenPromise;