Skip to content

Instantly share code, notes, and snippets.

View iRoachie's full-sized avatar

Kyle Roach iRoachie

View GitHub Profile
@iRoachie
iRoachie / deploy-static-site-heroku.md
Created February 7, 2016 05:27 — forked from wh1tney/deploy-static-site-heroku.md
How to deploy a static website to Heroku

Gist

This is a quick tutorial explaining how to get a static website hosted on Heroku.

Why do this?

Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.

Basic Assumptions

@iRoachie
iRoachie / combine.md
Created June 16, 2016 16:22
Gulp combine streams for erros

Combining streams to handle errors

By default, emitting an error on a stream will cause it to be thrown unless it already has a listener attached to the error event. This gets a bit tricky when you're working with longer pipelines of streams.

By using stream-combiner2 you can turn a series of streams into a single stream, meaning you only need to listen to the error event in one place in your code.

Here's an example of using it in a gulpfile:

var combiner = require('stream-combiner2');
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@iRoachie
iRoachie / _mixins.scss
Created September 14, 2016 17:35
Mixins
@import 'vars';
@mixin element($element) {
&__#{$element} {
@content;
}
}
@mixin modifier($element) {
&--#{$element} {
@iRoachie
iRoachie / subcategory.php
Last active January 6, 2021 14:44
Adds the ability to use custom templates for subcategories in wordpress
<?php
function new_subcategory_hierarchy() {
$category = get_queried_object();
$parent_id = $category->category_parent;
$templates = array();
if ( $parent_id == 0 ) {
// Use default values from get_category_template()
@iRoachie
iRoachie / even-odd-numbers.markdown
Last active October 28, 2016 19:01
Even, Odd Numbers
@iRoachie
iRoachie / tsf.json
Created May 12, 2017 13:23
Typescript React Native functional component Snippet
"React Native Functional Component": {
"prefix": "tsf",
"body": [
"import React from 'react'",
"import {",
" View,",
" Text,",
" StyleSheet,",
" ViewStyle,",
" TextStyle",
@iRoachie
iRoachie / ternary.jsx
Created June 10, 2017 05:35
Ternary Statement
class MeoMeo extends React.Component {
shouldComponentUpdate() {
return false
}
render() {
return this.props.type === 1 ? <Container1 /> : <Container2 />
}
}
@iRoachie
iRoachie / bottomNav.jsx
Created June 13, 2017 02:51
Bottom Nav Example
import React, { Component } from 'react'
import BottomNavigation, { Tab } from 'react-native-material-bottom-navigation'
import Icon from 'react-native-vector-icons/MaterialIcons'
class MyComponent extends Component {
this.state = {
activeIndex: 0
}
render() {
@iRoachie
iRoachie / themewrap.jsx
Created June 15, 2017 15:19
react native navigation
const wrap = (BaseComponent: any, navigatorStyle: NavigatorStyle = {}, navigatorButtons: {} = {}) =>
class WrappedComponent extends React.Component<any, any> {
static navigatorStyle = navigatorStyle
static navigatorButtons = navigatorButtons
render() {
return (
<ThemeProvider uiTheme={uiTheme}>
<BaseComponent {...this.props}/>
</ThemeProvider>