Skip to content

Instantly share code, notes, and snippets.

View Penderis's full-sized avatar

Keith Penderis

View GitHub Profile

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.

@Penderis
Penderis / assocCSV.php
Last active August 29, 2015 14:05
Create CSV from Associative Array - 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 / Laravel Ajax.js
Last active August 29, 2015 14:13
Laravel ajax that works
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 / Code Definitions that explain clearly
Created January 24, 2015 23:31
Code Explanations I can remember
##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 September 30, 2015 21:07
Add mailcatcher to Scotchbox
##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 / CalculateSavings.js
Created January 17, 2016 11:14
Calculate saving over period at 5% increase per month
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;
}
@Penderis
Penderis / downloadFacebookAlbum.js
Created September 16, 2016 01:05
Download facebook album when in full view
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;
}
<?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);
?>
Verifying my Blockstack ID is secured with the address 1442k9DeF52AJMAgePCRZvtooxvB4hAVAa https://explorer.blockstack.org/address/1442k9DeF52AJMAgePCRZvtooxvB4hAVAa
{"runeword":[{
id: 1,
name: "Steel",
category: o.a.WEAPON,
icon: "/images/items/00001.png",
value: "0",
type: w.OneHandedWeapon,
slots: [k.LeftHand, k.RightHand],
isNew: !1,
isEquipable: !0,