Skip to content

Instantly share code, notes, and snippets.

View feelosophy13's full-sized avatar

Howard feelosophy13

  • United States
View GitHub Profile
@bradtraversy
bradtraversy / pdo_db.php
Created February 21, 2018 12:56
PDO Class
<?php
/*
* PDO DATABASE CLASS
* Connects Database Using PDO
* Creates Prepeared Statements
* Binds params to values
* Returns rows and results
*/
class Database {
private $host = DB_HOST;
@joashp
joashp / openssl_encrypt_decrypt.php
Created September 4, 2015 15:59
Simple PHP encrypt and decrypt using OpenSSL
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/
@mcmtroffaes
mcmtroffaes / classification.r
Last active August 8, 2017 11:59
sample script for classification
# classification.r: generic R library for classification
# Copyright (C) 2014 Matthias C. M. Troffaes <matthias.troffaes@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@mcmtroffaes
mcmtroffaes / kfcv.r
Last active November 16, 2018 02:41
k-fold cross validation script for R
kfcv.sizes = function(n, k=10) {
# generate sample sizes for k-fold cross validation on a data set of
# size n
# author: Matthias C. M. Troffaes
# date: 22 Nov 2010
# license: GPLv3
# usage:
#
# kfcv.sizes(n, k=...)