Skip to content

Instantly share code, notes, and snippets.

@gellerby
gellerby / index.js
Created July 20, 2017 22:49
Slack to Sonos Integration with Node.js
'use strict';
const express = require('express');
const bodyParser = require('body-parser');
const request = require('request');
const SONOS_IP = 'http://localhost:5005';
const SONOS_LOGO = 'https://s3-us-west-2.amazonaws.com/slack-files2/avatars/2017-07-20/215502049474_61c514345eda4191188d_72.jpg';
const SLACK_API_URL = 'https://slack.com/api/chat.postMessage';
const TOKEN = 'xoxp-2161828497-14839469607-49280511392-a0596dcbd0';
const CHANNEL = 'C024RQCET'; // Big Sea Hangout
@gellerby
gellerby / 0_reuse_code.js
Created January 4, 2016 20:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@gellerby
gellerby / .htaccess
Created April 6, 2015 21:01
.htaccess file for browser caching of static assets
# Add Proper MIME-Type for Favicon
AddType image/x-icon .ico
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
<?php $cssupdate = '20150318'; ?>
<?php if ( isset($_COOKIE[ 'csscached']) && $_COOKIE[ 'csscached'] == $cssupdate ) : ?>
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/style.css?v=<?php echo $cssupdate; ?>">
<?php else : ?>
<style>
<?php include( bloginfo('template_directory') . '/css/critical.css'); ?>
</style>
<script>
/* Load critical CSS and cache stylesheet */
(function(win, doc) {
@gellerby
gellerby / Moving-Wordpress-Domain-SQL-Queries.sql
Last active August 29, 2015 14:16
SQL Queries for moving a Wordpress site's domain
UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.old-domain.com', 'http://www.new-domain.com');