Skip to content

Instantly share code, notes, and snippets.

View Penderis's full-sized avatar

Keith Penderis

View GitHub Profile
@Penderis
Penderis / Batch Recursive File Copier.bat
Last active July 23, 2023 11:29
Windows Batch Script to recursively copy files from folders into new folder using a text document with filenames
@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
.:-=+*##%%%%%%##*+=-:.
:=*%@@@%##*+++====+++**#%@@@%*=:
:+#@@@#*=-:::::::::::::::::::::-+*%@@%+:
-*@@%#+-:::::::::::::::::::::::::::::::-+#@@#=
.+@@%*=-::::::::::::::::::::::::::::::::::::::=#@@*:
:#@@#+=-::::::::::::##=::::##=::::##:::::::::::::::+%@%-
.#@@*==-::::::-:::::::@@=::::@@=::::@@-::::::-:::::::::=#@%-
+@@*==-:=++=::+@%+:::::@@#****@@#****@@:::::=#@*::::::::::=%@#.
:@@#==-:=@@%%@@+:=%@%-:::-*#####@@%####*=::::%@@+:::::::::::::+@@-
=@@+==-::@@+::+@@::+@@=::::::::=@@@@#::::::::-@@#-:::=#=:::::::::#@*
{"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,
Verifying my Blockstack ID is secured with the address 1442k9DeF52AJMAgePCRZvtooxvB4hAVAa https://explorer.blockstack.org/address/1442k9DeF52AJMAgePCRZvtooxvB4hAVAa
<?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 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;
}
@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 / 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 / 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 / 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' ),