Skip to content

Instantly share code, notes, and snippets.

View thinkstylestudio's full-sized avatar

Theron Smith thinkstylestudio

View GitHub Profile
/**
* Print Stylesheet fuer Deinewebsite.de
* @version 1.0
* @lastmodified 16.06.2016
*/
@media print {
/* Inhaltsbreite setzen, Floats und Margins aufheben */
/* Achtung: Die Klassen und IDs variieren von Theme zu Theme. Hier also eigene Klassen setzen */
@thinkstylestudio
thinkstylestudio / 1-macOS-10.13-high-sierra-setup.md
Created May 21, 2018 23:16 — forked from kevinelliott/1-macOS-10.13-high-sierra-setup.md
macOS 10.13 High Sierra Mostly-Automated Setup

macOS 10.13 High Sierra Mostly-Automated Setup

An easy to refer to document for regularly setting up macOS 10.13 High Siera, in flavor of my previous macOS/OSX setup gists:

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

@thinkstylestudio
thinkstylestudio / macro.md
Created May 8, 2018 20:47 — forked from brunogaspar/macro.md
Recursive Laravel Collection Macros

What?

If a nested array is passed into a Laravel Collection, by default these will be threaded as normal arrays.

However, that's not always the ideal case and it would be nice if we could have nested collections in a cleaner way.

This is where this macro comes in handy.

Setup

@thinkstylestudio
thinkstylestudio / eloquent-cheatsheet.php
Created May 7, 2018 22:30 — forked from hassansin/eloquent-cheatsheet.php
Laravel 5 Eloquent CheatSheet #laravel #eloquent
Model::
/*Select*/
select('col1','col2')
->select(array('col1','col2'))
->select(DB::raw('businesses.*, COUNT(reviews.id) as no_of_ratings, IFNULL(sum(reviews.score),0) as rating'))
->addSelect('col3','col4')
->distinct() // distinct select
/*From*/
<?php
$macro = var_export($wpTermsArray, true);
$macro = str_replace("stdClass::__set_state", "(object)", $macro);
$wpTermsArray = '$data = ' . $macro . ';';
echo $wpTermsArray;
composer global remove laravel/valet
rm -rf ~/.valet
brew unlink nginx && brew remove nginx && brew uninstall --force nginx
brew unlink [email protected] && brew remove [email protected]
brew unlink dnsmasq && brew remove dnsmasq
composer global require laravel/valet &&
valet install &&
ping foobar.test
@thinkstylestudio
thinkstylestudio / gist:5b99ca3a5168de48eb59a72cb4994e87
Created March 1, 2018 21:25
How to Efficiently Clean Hidden Link Injections in Your Hacked WordPress Sites - https://managewp.com/blog/clean-link-injections-hacked-websites
<?php
// By default only preview infected posts. Change to 0 to clean posts
$preview_only = 1;
// This is the pattern to search and replace with blank
$pattern = '|
posts where post_content LIKE '%display: none%'";
@thinkstylestudio
thinkstylestudio / HigherOrderOptionalProxy.php
Created August 28, 2017 05:54 — forked from derekmd/Optional.php
Laravel global helper function `optional()`
<?php
namespace App\Support;
class HigherOrderOptionalProxy
{
/**
* The target being transformed.
* Use _ prefix to avoid namespace conflict on __get()
*
@thinkstylestudio
thinkstylestudio / null_pattern.php
Created June 13, 2017 01:03 — forked from eric1234/null_pattern.php
A null object pattern implemented in PHP
<?php
# Implements a recursive null object pattern.
#
# Implemented as a trait so any object can make it's properties use
# the null pattern without resorting to inheritance.
#
# The goal is so you can pull data off a partially populated object
# without excessive existance checks.
trait NullPattern {
@thinkstylestudio
thinkstylestudio / launcher.sh
Created June 1, 2017 18:11 — forked from robertoestivill/launcher.sh
Bash alternative to Franz
#!/bin/bash
open -a "Google Chrome" --new --args --new-window \
'https://tweetdeck.twitter.com' \
'https://web.whatsapp.com' \
'https://blastersystems.slack.com/' \
'https://www.messenger.com/' \
'https://web.telegram.org/' \
'https://web.skype.com' \
'https://hangouts.google.com/' \