Skip to content

Instantly share code, notes, and snippets.

<?php
// pass a url
function getStuff($url){
// go get the content from that url
// then convert the content to a php object
return json_decode(file_get_contents($url));
}
// get the person data
http://www.missiontolearn.com/2013/10/self-directed-learning-success/
1. Takes initiative
2. Is comfortable with independence
3. Is persistent
4. Accepts responsibility
5. Views problems as challenges, not obstacles
6. Is capable of self-discipline
7. Has a high degree of curiosity
8. Has a strong desire to learn or change
@trevorgreenleaf
trevorgreenleaf / gist:aacffbd29fa8e299fd40194be66ad008
Created December 19, 2017 08:05
Remove large file accidentally committed to git
git filter-branch --tree-filter 'rm -rf path/to/your/file' HEAD
int led1 = D0;
// the little blue LED on your board
int led2 = D7;
// when the device starts up it will run the setup function or when the device is reset
// void meaning it is not going to return a value
void setup() {
// We are going to tell our device that D0 and D7 (which we named led1 and led2 respectively) are going to be output
@trevorgreenleaf
trevorgreenleaf / gist:693368e0b6dc70aa22d15e2498c3625f
Created July 24, 2018 14:21
Particle Photon Workshop | On off via a web browser
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>IOT Workshop | Particle.io LED Light turn On</title>
<!-- <link href="https://cdn.jsdelivr.net/npm/tailwindcss/dist/tailwind.min.css" rel="stylesheet"> -->
</head>
<body>
<div id="app">
# redirect to new domain
rewrite ^/(.*) https://some-domain.com/$1 permanent;
@trevorgreenleaf
trevorgreenleaf / reset.css
Last active May 21, 2018 21:12
CSS Normalize
/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
@trevorgreenleaf
trevorgreenleaf / imagick3.4.3-PHP7.1-forge.sh
Created April 11, 2018 16:34 — forked from jacobmllr95/imagick3.4.3-PHP7.1-forge.sh
Install Imagick 3.4.3 on PHP 7.1 server (Laravel Forge)
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get install pkg-config libmagickwand-dev -y
cd /tmp
wget https://pecl.php.net/get/imagick-3.4.3.tgz
tar xvzf imagick-3.4.3.tgz
apt-get update
apt-get install php-imagick
service php7.0-fpm restart
service nginx restart
@trevorgreenleaf
trevorgreenleaf / gist:b1508d5524d43a666757f9e9fd1e3903
Created September 24, 2017 21:13
Laravel Error Whoops Snippet
@if (count($errors) > 0)
<div class="alert alert-danger text-left">
<strong>Whoops!</strong> There were problems with input:
<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>