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 / 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 / gist:ff931477e4697a4ba50e
Created November 21, 2014 02:58
Reuters Ticker in Lo Fi Coffee
##MAP LAYOUT FOR SERIAL OUT
##Interval(320000)=>RSS Request(http://feeds.reuters.com/reuters/topNews)=>Function
Function:
var welcome = "Welcome to Lo Fi Coffee";
var news1 = msg.rss.channel.item[0].title;
var news2 = msg.rss.channel.item[1].title;
var news3 = msg.rss.channel.item[2].title;
var news4 = msg.rss.channel.item[3].title;
var news5 = msg.rss.channel.item[4].title;
@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
@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 / 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
//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 {
<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 / Open Closed for Business
Last active November 1, 2016 21:54
Uses javascript to determine hours of operation
//Establish Open/Closed Variable
var currentStatus = "closed";
//Establish Day of Week
var date = new Date();
function getWeekDay(date) {
var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
return days[date.getDay()]
}
var day = date.getDate()
@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;
@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'