Skip to content

Instantly share code, notes, and snippets.

View sikofitt's full-sized avatar
🏠
Working from home

Eric sikofitt

🏠
Working from home
View GitHub Profile
@sikofitt
sikofitt / pecl_ssh2_stream.php
Last active February 7, 2021 04:23
Example of using the ssh2.sftp:// stream from the ssh2 pecl extension
<?php declare(strict_types=1);
// Tested on
// PHP 7.4.14 (cli) (built: Jan 5 2021 15:12:29) ( ZTS Visual C++ 2017 x64 )
// Windows 10 Pro
// pecl ssh2 v1.2
// Remote server
// Gentoo GNU/Linux Base System release 2.7
error_reporting(E_ALL);
@sikofitt
sikofitt / pecl_ssh2.php
Last active February 7, 2021 04:35
Working example of the pecl ssh2 extension copying files to remote.
<?php declare(strict_types=1);
// Tested on
// PHP 7.4.14 (cli) (built: Jan 5 2021 15:12:29) ( ZTS Visual C++ 2017 x64 )
// Windows 10 Pro
// pecl ssh2 v1.2
// Remote server
// Gentoo GNU/Linux Base System release 2.7
error_reporting(E_ALL);

Keybase proof

I hereby claim:

  • I am sikofitt on github.
  • I am sikofitt (https://keybase.io/sikofitt) on keybase.
  • I have a public key ASB-qFKZnqnlLHfzBg_CsOGOSb-r8R5wikEKlen5WEkB5Ao

To claim this, I am signing this object:

@sikofitt
sikofitt / search.js
Created July 27, 2017 16:25
On the fly search that hides divs that don't match.
searchPage = function(searchElem, divClass, hiddenClass) {
jQuery(divClass).removeClass(hiddenClass);
var search = document.getElementById(searchElem);
var needle = search.value;
needle = needle.toLowerCase();
var searchStrings = needle.split(/\W/);
for (var i = 0, len = searchStrings.length; i < len; i++) {
var currentSearch = searchStrings[i].toLowerCase();
@sikofitt
sikofitt / composer.json
Last active July 2, 2021 19:51
Guzzle promise example and Pool example
{
"name": "sikofitt/guzzle-example",
"description": "Guzzle Example",
"type": "project",
"require": {
"php":">=5.6",
"guzzlehttp/guzzle": "^6.2"
},
"require-dev": {
"symfony/var-dumper": "^3.2",
@sikofitt
sikofitt / reformat.js
Created May 12, 2016 16:42
Reformat a page with javascript using a bookmark.
javascript:(function() {
var webFont = document.createElement('script');
webFont.src = ('https:' == document.location.protocol ? 'https' : 'http')
+'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
webFont.type = 'text/javascript';
webFont.async = true;
document.querySelector('body').appendChild(webFont);
WebFontConfig = {
google: {