Skip to content

Instantly share code, notes, and snippets.

View rizerzero's full-sized avatar
🎯
Focusing

Juba B rizerzero

🎯
Focusing
View GitHub Profile
@rizerzero
rizerzero / gist:2004510
Created March 9, 2012 01:30
php : test
<?php
echo "testing gist";
echo "Upsdating gist";
?>
@rizerzero
rizerzero / crud_event_logger.php
Created March 9, 2012 01:42 — forked from mitio/crud_event_logger.php
Simple CrudEventLogger
<?
// in lib/classes/crudeventlogger.php
class CrudEventLogger {
protected $event = null;
protected $table_name = null;
protected $record_id = null;
protected $user_id = null;
protected $before = array();
protected $after = array();
@rizerzero
rizerzero / html
Created October 25, 2012 01:41
html_base
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>my web page </title>
</head>
<body>
</body>
<?php
public function getImageSizeKeepAspectRatio( $imageUrl, $maxWidth, $maxHeight)
{
$imageDimensions = getimagesize($imageUrl);
$imageWidth = $imageDimensions[0];
$imageHeight = $imageDimensions[1];
$imageSize['width'] = $imageWidth;
@rizerzero
rizerzero / cacert.pem
Last active August 29, 2015 14:17 — forked from HTMLGuyLLC/cacert.pem
##
## ca-bundle.crt -- Bundle of CA Root Certificates
##
## Certificate data from Mozilla as of: Sat Dec 29 20:03:40 2012
##
## This is a bundle of X.509 certificates of public Certificate Authorities
## (CA). These were automatically extracted from Mozilla's root certificates
## file (certdata.txt). This file can be found in the mozilla source tree:
## http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1
##
@rizerzero
rizerzero / devops_training.txt
Created November 24, 2018 18:01 — forked from ssmythe/devops_training.txt
Training materials for DevOps
======
Videos
======
DevOps
What is DevOps? by Rackspace - Really great introduction to DevOps
https://www.youtube.com/watch?v=_I94-tJlovg
Sanjeev Sharma series on DevOps (great repetition to really get the DevOps concept)
@rizerzero
rizerzero / aws.py
Created January 7, 2019 10:17 — forked from philkuz/aws.py
check S3 bucket exists with python
from aws import bucket_exists, upload_path
bucket_name = 'cnns-music-vids'
directory_to_upload = 'data/'
output_s3_directory = 'data/'
if bucket_exists(bucket_name):
print('the bucket exists!')
else:
raise ValueError('nah the bucket does not exist')
APP_DEV=static.intermail.dev.$1.jp7.com.br
echo "Creating S3 development bucket " $APP_DEV"...\n"
aws s3api create-bucket --bucket $APP_DEV --region us-east-1
echo "Setting Static Web Hosting...\n"
aws s3api put-bucket-website --bucket $APP_DEV --website-configuration file://website-config.json
echo "Bucket" $APP_DEV "created, visit AWS Console to create IAM user for said bucket.\n"
APP_QA=static.intermail.qa.$1.jp7.com.br
@rizerzero
rizerzero / .bash_prompt.sh
Created February 20, 2019 11:39 — forked from miki725/.bash_prompt.sh
Custom bash prompt which displays: (virtualenv) user:/path (git-branch)
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch of the current git/mercurial repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.

Zero to Database with Laravel

Part 1: Seeding and Viewing

[Laravel][] is a PHP framework that's really a joy to work with -- though I did find the initial learning curve a bit steep.

This tutorial describes a minimum set of steps necessary to pull content from a database and dump it to a url using Laravel's Eloquent ORM. For me, that was the breakthrough moment.

Assuming you've got [Laravel installed][install] and the [database configured][configure], here are the steps needed to get your data from the database into a web browser:

  1. Create a migration