Skip to content

Instantly share code, notes, and snippets.

Nate Adams n8jadams

Block or report user

Report or block n8jadams

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
astenmies / graphql-go-mongodb-example.go
Last active Jun 23, 2019
Minimal example of GraphQL Golang and MongoDB playing nicely together. Edit
View graphql-go-mongodb-example.go
// Embedded in this article
package main
import (
simonhamp / AppServiceProvider.php
Last active Sep 8, 2019
A pageable Collection implementation for Laravel
View AppServiceProvider.php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
public function boot()
pixeline /
Last active May 14, 2019
Update Mac Os X's php version to php 7.1 using homebrew. Includes curl and mcrypt
# 1. Install brew -->
# 2. run the following commands in your Terminal
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install --with-openssl curl
brew install --with-homebrew-curl --with-apache php71
brew install php71-mcrypt php71-imagick
# 3. Follow these instructions to make Apache and php-cli use the newer php executable and make the change persist after reboot.
brew info php71
molivier / gist:271bba5d67de1583a8e3
Last active Sep 17, 2019
Set $GOPATH on Mac OSX : bash_profile
View gist:271bba5d67de1583a8e3
# Edit ~/.bash_profile
export GOPATH=/Users/$USER/go
export PATH=$GOPATH/bin:$PATH
# Reload profile : source ~/.bash_profile
ziggi / parents.js
Created Apr 13, 2015
Vanilla JS jQuery.parents() realisation
View parents.js
Element.prototype.parents = function(selector) {
var elements = [];
var elem = this;
var ishaveselector = selector !== undefined;
while ((elem = elem.parentElement) !== null) {
if (elem.nodeType !== Node.ELEMENT_NODE) {
JayWood / closetags.php
Created Jul 18, 2014
Close ALL open HTML tags in PHP string
View closetags.php
function closetags($html) {
preg_match_all('#<([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result);
$openedtags = $result[1];
preg_match_all('#</([a-z]+)>#iU', $html, $result);
$closedtags = $result[1];
$len_opened = count($openedtags);
kkirsche / Install Composer to use MAMP's
Last active Sep 17, 2019
How to install Composer globally using MAMP's PHP
View Install Composer to use MAMP's

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile

This will open nano with the contents, at the top in a blank line add the following line:

jfloff /
Last active Aug 31, 2019
How to get MAMP to work with SSL ... Yes really.

First of all you need to be able to run MAMP in port 80. This is a "heat check" if you don't have any process jamming http ports. You can check it like this:

sudo lsof | grep LISTEN

If you do happen to have any process with something like this *:http (LISTEN), you are in trouble. Before with adventure check if it isn't MAMP itself (yeah, you should close that beforehand)

ps <pid of that process>

If you don't see MAMP, you are in good hands, I have just the thing for you:

You can’t perform that action at this time.