Skip to content

Instantly share code, notes, and snippets.

View buttflattery's full-sized avatar
🎯
Focusing

Coackroach buttflattery

🎯
Focusing
View GitHub Profile
Attention: Last command is correctly
akhisamov@dev0 APICO.API_akhisamov % ./yii gii/model --tableName=invoice --modelClass=Invoice --queryNs='frontend\modules\v2\models\ar' --ns='frontend\modules\v2\models\ar' --db=db2
@buttflattery
buttflattery / lazy-video-loader.js
Created May 20, 2019 14:39 — forked from benrobertsonio/lazy-video-loader.js
Lazy Loading Video Based on Connection Speed
class LazyVideoLoader {
constructor() {
this.videos = [].slice.call(document.querySelectorAll('.hero__bgvideo'));
// Abort when:
// - The browser does not support Promises.
// - There no videos.
// - If the user prefers reduced motion.
// - Device is mobile.
if (
@buttflattery
buttflattery / curl.md
Created April 25, 2019 12:49 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@buttflattery
buttflattery / README.md
Created January 25, 2019 10:01 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@buttflattery
buttflattery / BaseController.php
Created January 19, 2019 12:01 — forked from cebe/BaseController.php
Yii2 API Auth with username and password
<?php
/**
*
*
* @author Carsten Brandt <[email protected]>
*/
namespace api\components;
use common\models\ApiSystem;
@buttflattery
buttflattery / array_flatten.php
Created December 24, 2018 19:34 — forked from SeanCannon/array_flatten.php
PHP array_flatten() function. Convert a multi-dimensional array into a single-dimensional array.
<?php
/**
* Convert a multi-dimensional array into a single-dimensional array.
* @author Sean Cannon, LitmusBox.com | [email protected]
* @param array $array The multi-dimensional array.
* @return array
*/
function array_flatten($array) {
if (!is_array($array)) {
class E2ETestCase extends PHPUnit_Framework_TestCase
{
protected $driver;
public function setUp()
{
$this->driver = App_Factory_RemoteWebDriver::factory();
}
// more here.