Skip to content

Instantly share code, notes, and snippets.

View samrocksc's full-sized avatar
:shipit:
LFG

Sam Clark samrocksc

:shipit:
LFG
View GitHub Profile
@samrocksc
samrocksc / docker-compose.yml
Created February 25, 2019 18:15
Local Mysql 5.6
version: '3'
services:
mysql:
image: mysql:5.6
restart: unless-stopped
container_name: mysql
ports:
- '3306:3306'
expose:
- '3306'
@samrocksc
samrocksc / Sorting a list
Created September 11, 2018 17:59
Sorting Things
import countryCodes from './countryCodes.json';
const countryCallingCodeList = () => {
let codes = [];
countryCodes
.filter(country => {
if (country.countryCallingCodes.length === 0) {
return false;
}
return true;
const phonepad = [
[],
[],
['a', 'b', 'c'],
['d', 'e', 'f'],
['g', 'h', 'i'],
['j', 'k', 'l'],
['m', 'n', 'o'],
['p', 'q', 'r', 's'],
['t', 'u', 'v'],
<header class="banner navbar navbar-default navbar-static-top" role="banner">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<i id="toggle-menu"></i>
</button>
<a class="navbar-logo" href="<?php echo esc_url(home_url('/')); ?>">
<picture>
<!--[if IE 9]><video style="display: none;"><![endif]-->
@samrocksc
samrocksc / extras.php
Last active December 10, 2021 08:54
<?php
/**
* Clean up the_excerpt()
*/
function roots_excerpt_more() {
return ' &hellip; </p><p><a href="' . get_permalink() . '"><strong>' . __('Read More', 'roots') . '</strong></a>';
}
add_filter('excerpt_more', 'roots_excerpt_more');
//ES6 React Component imports, standard
import React, { Component } from 'react'
//import our redux connectors
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
//import our action file so that we can quickly dispatch whatever we need.
import * as ImportedActions from '../actions/actionFile';
//kick off the main component
export default class componentName extends Component {
@samrocksc
samrocksc / tmux.conf
Created October 29, 2015 16:25 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@samrocksc
samrocksc / cors.js
Created September 15, 2015 17:39 — forked from monteslu/cors.js
hapi cors
{
method: 'POST',
path: '/dostuff',
config: {
auth: false,
cors: {
additionalHeaders: ['accept']
},
handler: handleStuff
}
@samrocksc
samrocksc / hapiExample.js
Last active August 28, 2015 21:42 — forked from nvcexploder/hapiExample.js
basic hapi.js example highlighting HTTP methods and a few request parameters
/*
For this to run, ensure that `npm install hapi` has happened in your directory
setup whilst writing this:
iojs v. 1.0.5
hapi 8.2.0
*/
var Hapi = require('hapi');
@samrocksc
samrocksc / hapijs-rest-api-tutorial.md
Last active August 29, 2015 14:28 — forked from agendor/hapijs-rest-api-tutorial.md
A practical introduction to building a RESTful API with the hapi.js server framework for Node.js