Skip to content

Instantly share code, notes, and snippets.

View mamchenkov's full-sized avatar
🇨🇾
Working, one commit at a time.

Leonid Mamchenkov mamchenkov

🇨🇾
Working, one commit at a time.
View GitHub Profile
@mamchenkov
mamchenkov / 0_reuse_code.js
Created June 6, 2016 22:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
* -A in SSH enables agent forwarding.
* -p 2122 is not needed if you use the default port of 22.
* Replace SSH_USER and example.com with your own values.
* Example run: $ envoy run deploy_demo
* --no-scripts because Laravel composer.json's post-install-cmd includes optimize, which is already done by php artisan dump-autoload
@servers(['test' => '-A -p 2122 -l user test.example.com', 'prod' => '-A -p 2122 -l user example.com'])
@task('install_test', ['on' => ['test']])
cd project
1. Copy ssh public key to rsync.net server:
[jim@mb hbdev]$ scp ~/.ssh/id_rsa.pub XXXX@usw-s002.rsync.net:.ssh/authorized_keys
Password:
id_rsa.pub
100% 392 0.4KB/s 00:00
2. Create a local HashBackup backup directory:
@mamchenkov
mamchenkov / object-iframe-with-fallback.html
Last active August 29, 2015 14:07 — forked from paulirish/gist:616412
Object tag as an iframe, with fallbacks
<!-- so it turns out that the object tag can act like an iframe
but the cool thing is you can nest object tags inside eachother for a fallback path.
what this means is you can "objectframe" a site.. and if it fails.. (site down, offline, whatever).. it'll use the next one.
so you can objectframe the live site and fallback to a screenshot.
or something.
demo at : http://jsfiddle.net/paul/CY2FQ/1/
-->
<?php
$obj = new FileFinder($argv[1]);
$obj->setFileType(array_slice($argv, 2));
$obj->setExcludingDirectories(array('test1'));
$pages = $obj->find();
print_r($pages);
class FileFinder {
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(