Skip to content

Instantly share code, notes, and snippets.

Keith Penderis

Block or report user

Report or block Penderis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:ff551d08406b9b1b789b403821d195bd
Verifying my Blockstack ID is secured with the address 1442k9DeF52AJMAgePCRZvtooxvB4hAVAa https://explorer.blockstack.org/address/1442k9DeF52AJMAgePCRZvtooxvB4hAVAa
View get jpg image
<?php
$imgGet = file_get_contents("https://scontent.fjnb4-1.fna.fbcdn.net/v/t1.0-9/12472335_10154123172874233_8175404566332742685_n.jpg?oh=ad1bdd1889e2e25fa806965595385528&oe=58CE7AEA");
file_put_contents("newfile.jpg",$imgGet);
?>
@Penderis
Penderis / downloadFacebookAlbum.js
Created Sep 16, 2016
Download facebook album when in full view
View downloadFacebookAlbum.js
function gettingNext(){
var getNext = document.getElementsByClassName('snowliftPager next');
//console.log(getNext);
return getNext;
}
function newOptions(){
var options = document.querySelector('a[data-action-type="open_options_flyout"');
// console.log(options);
return options;
}
@Penderis
Penderis / CalculateSavings.js
Created Jan 17, 2016
Calculate saving over period at 5% increase per month
View CalculateSavings.js
var Interest = 1.05;
var Base = 200;
var Total = 0;
var Count = 12;
for (i = 1;i< Count;i++){
console.log("Base: "+Base*Interest)
console.log("Total: "+Total)
Total += Base;
Base = Base*Interest;
}
View Code Definitions that explain clearly
##PHP Interfaces
It seems like many contributors are missing the point of using an INTERFACE. An INTERFACE is not specifically provided for abstraction. That's what a CLASS is used for. Most examples in this article of interfaces could be achieved just as easily using just classes alone.
An INTERFACE is provided so you can describe a set of functions and then hide the final implementation of those functions in an implementing class. This allows you to change the IMPLEMENTATION of those functions without changing how you use it.
For example: I have a database. I want to write a class that accesses the data in my database. I define an interface like this:
interface Database {
function listOrders();
function addOrder();
@Penderis
Penderis / Mailcatcher Vagrant
Last active Sep 30, 2015
Add mailcatcher to Scotchbox
View Mailcatcher Vagrant
##source http://alfrednutile.info/posts/93
Using MailCatcher http://mailcatcher.me/ I can see the emails sent by the website.
First checkout https://github.com/fideloper/Vaprobash/pull/348 to get your box ready All I did was
Log into the vagrant box and run
sudo apt-get install libsqlite3-dev
Then
sudo apt-get install ruby1.9.1-dev -y
@Penderis
Penderis / Laravel Ajax.js
Last active Aug 29, 2015
Laravel ajax that works
View Laravel Ajax.js
jQuery( document ).ready( function( $ ) {
console.log("start");
$( '#form-add-setting' ).on( 'submit', function() {
//.....
//show some spinner etc to indicate operation in progress
//.....
console.log("Submitting");
$.post(
$( this ).prop( 'action' ),
@Penderis
Penderis / assocCSV.php
Last active Aug 29, 2015
Create CSV from Associative Array - PHP
View assocCSV.php
$header=null;
//header nulled first line will make not nulled thus creating csv with header values
$pathToGenerate = "path to new file location including filename";
//create directory if does not exist beforehand, file will be created or override in fopen with w+ flag
$createFile = fopen($pathToGenerate,"w+");
foreach ($assocArray as $row) {
if(!$header){
//this matches the first line to create header values
@Penderis
Penderis / Batch Recursive File Copier.bat
Last active Aug 29, 2015
Windows Batch Script to recursively copy files from folders into new folder using a text document with filenames
View Batch Recursive File Copier.bat
@echo off
CLS
setlocal EnableDelayedExpansion
REM Changes root path to relative of current bat folder
pushd "%~dp0"
REM finds files in provided .txt file and copies them to destination directory
REM CHECK FOR ADMIN RIGHTS
COPY /b/y NUL %WINDIR%\06CF2EB6-94E6-4a60-91D8-AB945AE8CF38 >NUL 2>&1
View CSS-Line-break---Color-Control.markdown

CSS Line break - Color Control

Hoping to find a easy multi use CSS line break method for Inline text to wrap with padding. This is a combination of the box-shadow and border-left method , such case that box-shadow does not work I still have left padding. Small price to pay. Multi Line Text - CSS Tricks

A Pen by Keith on CodePen.

License.

You can’t perform that action at this time.