Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Stecker mikestecker

  • Menifee, CA
  • 11:33 (UTC -08:00)
View GitHub Profile
@mikestecker
mikestecker / optimising-unifi-performance.md
Last active Dec 1, 2022
optimising-unifi-performance
View optimising-unifi-performance.md

optimising-unifi-performance

NOTE: Content below is written by Adrian Mace. Click here for an updated version.

Below are the key settings that I apply on any unifi installation for optimal performance.

Settings

Settings > Site

  • Ensure Enable Advanced Features is enabled
    This allows you to follow along with the guide in it's entirety.
View keybase.md

Keybase proof

I hereby claim:

  • I am mikestecker on github.
  • I am mikestecker (https://keybase.io/mikestecker) on keybase.
  • I have a public key ASDJw_o_pQnI9x-y4k011cQJrHGO2vM7zYQVwNe9QFcbuwo

To claim this, I am signing this object:

View Twig truncate macro
{% macro truncate(text, limit, append) %}
{# settings #}
{% set suffix = append|default('...') %}
{% set punctuation = ['.',',','-',':',';'] %}
{# logic #}
{% set array = text|split(' ') %}
{% set arrayTruncated = array|slice(0, limit) %}
{% set string = arrayTruncated|join(' ') %}
{% if limit and array|length > limit %}
{% for mark in punctuation %}
@mikestecker
mikestecker / server-setup.sh
Last active Apr 16, 2019
Bash script for my server setup with Digital Ocean, Server Pilot with Node, Gulp and Craft
View server-setup.sh
For Buddy to be able to update NGINX and run other commands as root, you need to follow these steps to give the user buddy access.
If no user has been created, follow the guide here to create a user for Buddy:
https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-ubuntu-16-04
1. On ubuntu based systems, run " $ sudo visudo "
2. this will open /etc/sudoers file.
3. If your buddy user is already in that file, then modify to look like this:
buddy ALL=(ALL) NOPASSWD: ALL
@mikestecker
mikestecker / vue.twig
Created Sep 26, 2016 — forked from mmikkel/vue.twig
Vue.js Craft template
View vue.twig
{% includeJsFile('https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.26/vue.js') %}
{% set script %}
Vue.config.debug = true;
Vue.config.delimiters = ['${', '}'];
new Vue({
el: '#content',
data: {
message: 'Hello Vue.js!'
View trello-css-guide.md

Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

This is where any fun you might have been having ends. Now it’s time to get serious and talk about rules.

Writing CSS is hard. Even if you know all the intricacies of position and float and overflow and z-index, it’s easy to end up with spaghetti code where you need inline styles, !important rules, unused cruft, and general confusion. This guide provides some architecture for writing CSS so it stays clean and ma

View block-grid.scss
// Block Grid
// Technique adapted from Foundation 5 for Bootstrap 3.
// https://github.com/zurb/foundation/blob/f755d8704123f86c281ede0b171881e2672f150d/scss/foundation/components/_block-grid.scss
// Original LESS Version by Christopher Mitchell (https://gist.github.com/ChrisTM)
// Converted to SCSS by Rasmus Jürs (https://github.com/Jursdotme)
[class*="block-grid-"] {
display: block;
margin: -($grid-gutter-width/2);
padding: 0;
@mikestecker
mikestecker / gist:792bce5f9ec4d925e7dd
Last active Aug 29, 2015
Fix for 'Call to undefined method Cp::set_variable()' in Channel Search
View gist:792bce5f9ec4d925e7dd
In 'channel_search/mcp.channel_search.php' replace line 102 which is:
$this->EE->cp->set_variable('cp_page_title', lang('channel_search_module_name'));
With this:
if ( version_compare( APP_VER, '2.6.0', '<' ) ) {
ee()->cp->set_variable('cp_page_title', lang('channel_search_module_name'));
} else {
ee()->view->cp_page_title = lang('channel_search_module_name');
View readme.md

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@mikestecker
mikestecker / lamp-setup.md
Last active Jul 30, 2018
This guide shows howto install Apache HTTP Server (httpd) with PHP 5.5.9 and following modules on Fedora 20/19/18/17, CentOS 6.5/6.4/6.3/6.2/6.1/6/5.10 and Red Hat (RHEL) 6.5/6.4/6.3/6.2/6.1/6/5.10 systems.
View lamp-setup.md

Install Apache/PHP 5.5.9 on Fedora 20/19, CentOS/RHEL 6.5/5.10

This guide shows howto install Apache HTTP Server (httpd) with PHP 5.5.9 and following modules on Fedora 20/19/18/17, CentOS 6.5/6.4/6.3/6.2/6.1/6/5.10 and Red Hat (RHEL) 6.5/6.4/6.3/6.2/6.1/6/5.10 systems.

  1. Change root user

su -
## OR ##

sudo -i