Skip to content

Instantly share code, notes, and snippets.

View taivu's full-sized avatar

Tai taivu

View GitHub Profile
@taivu
taivu / .bash_profile
Created February 26, 2017 06:49 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@taivu
taivu / dnsmasq OS X.md
Created February 27, 2017 14:29 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.

Requirements

Install

@taivu
taivu / brew-instructions.sh
Created February 27, 2017 14:30 — forked from petemcw/brew-instructions.sh
Setup dnsmasq on Mac OS X
# Install `dnsmasq` and configure for *.dev domains
$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf
# Reload configuration and clear cache
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ dscacheutil -flushcache
<?php
// D8 themes, should go in MYDOPEASSTHEME.theme
/**
* Implements hook_theme_suggestions_HOOK_alter().
*/
function MYDOPEASSTHEME_theme_suggestions_page_alter(array &$suggestions, array $vars) {
$node = \Drupal::routeMatch()->getParameter('node');
if (!empty($node)) {

Keybase proof

I hereby claim:

  • I am taivu on github.
  • I am taivu (https://keybase.io/taivu) on keybase.
  • I have a public key ASCxwiW-Rw1zttVq5N1m_2XN8MZgw9FQLfzMu1yttE-4wgo

To claim this, I am signing this object:

@taivu
taivu / js-css3-animate-max-height.js
Last active September 21, 2017 21:00
Vanilla JS + CSS3 Animate: open and close using max-height
// https://developer.mozilla.org/en-US/docs/Web/API/Element/classList
// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight
function toggleHider() {
var hiderToggle = document.getElementsByClassName('hider__toggle')[0];
hiderToggle.classList.toggle('is-open');
var hiderContent = document.getElementsByClassName('hider__content')[0];
@taivu
taivu / _icons.scss
Created October 11, 2017 17:24
vudu style - icons sprite
$icon-size: 5.417em; //65px
.icon {
transition: transform .25s ease;
width: $icon-size;
height: $icon-size;
display: inline-block;
background-image: url('../img/sprite-icons.svg'); // icons are 75x75
background-position: 0 0;
background-size: auto 100%;
// ### customize webforms
// 00. Make sure `webforms` module is install in drupal
// 01. login as admin and go into `structure > webforms`.
// 02. find the row of your form, click `build` on the far right
// 03. click on `+ Add Element` button near top of table
// 04. in filter input box, type `container`, then click `Add Element`
// 05. in the "Key" input field, type in something descriptive. I reccommend `{FORMNAME}__group_{#}`. Replace `{FORMNAME}` with the form name and `{#}` with a number. ex: `myform__group_2`
// 06. now, click on the `Advanced` tab near the top.
// 07. now click in the input field `Element CSS Classes`. Select `Custom`.
// 08. a new input field shows up underneath. type in one of the following classes:
@taivu
taivu / drupal 8 modules.md
Created October 25, 2017 18:50
drupal 8 modules i like using
Module Description
address robust address field for locations
admin_toolbar dropdown admin menus
anchor_link
better_exposed_filters
captcha spam protection for webforms
crop expose image cropping api
cshs
ctools needed by pathauto
@taivu
taivu / git-feature-workflow.md
Created October 30, 2017 13:43 — forked from blackfalcon/git-feature-workflow.md
Git basics - a general workflow

There are many Git workflows out there, I heavily suggest also reading the atlassian.com [Git Workflow][article] article as there is more detail then presented here.

The two prevailing workflows are [Gitflow][gitflow] and [feature branches][feature]. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited.

When using Bash in the command line, it leaves a bit to be desired when it comes to awareness of state. I would suggest following these instructions on [setting up GIT Bash autocompletion][git-auto].

Basic branching

When working with a centralized workflow the concepts are simple, master represented the official history and is always deployable. With each now scope of work, aka feature, the developer is to create a new branch. For clarity, make sure to use descriptive names like transaction-fail-message or github-oauth for your branches.