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 / 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 / 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 / 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 / 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 / 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 {
@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');
<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]-->
const phonepad = [
[],
[],
['a', 'b', 'c'],
['d', 'e', 'f'],
['g', 'h', 'i'],
['j', 'k', 'l'],
['m', 'n', 'o'],
['p', 'q', 'r', 's'],
['t', 'u', 'v'],