Skip to content

Instantly share code, notes, and snippets.

Tate Johnson tatey

Block or report user

Report or block tatey

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tatey
tatey / es_index_conflict_mapping
Last active Jan 28, 2016
Identify conflicting field mappings in ElasticSearch 1.x > 2.0 upgrade
View es_index_conflict_mapping
#!/usr/bin/env ruby
require 'json'
if ARGV.size < 1
puts "usage: #{__FILE__} <FILE1> [FILE2 ...]"
puts " eg: ./es_index_conflict_mapping applogs-2016.01.10.json applogs-2016.01.13.json applogs-2016.01.08.json applogs-2016.01.11.json applogs-2016.01.27.json"
abort
end
View hklifxd.sh
#!/bin/sh
### BEGIN INIT INFO
# Provides: hklifxd
# Required-Start: $local_fs $network
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: hklifxd initscript
# Description: HomeKit bridge for LIFX lights
View style.swift
import UIKit
class Style {
static let tableCellInset: CGFloat = 15.0
}
class StyleColor {
static let primaryBackgroundColor = UIColor.blackColor()
static let primaryTextColor = UIColor.whiteColor()
static let secondaryTextColor = UIColor(red: 0.45, green: 0.45, blue: 0.45, alpha: 1)
View 0_type.cr
enum Type : UInt16
DeviceGetService = 2
DeviceStateService
DeviceGetPower = 20
DeviceSetPower
DeviceStatePower
def c_struct
{% if true %}
case self
View gist:b7fe5a95eba5cbf47757
in macro 'macro_4595589792' /Users/Tate/Desktop/lifx-crystal/src/lifx/message/type.cr:11, line 5:
1.
2. case self
3.
4. when DeviceGetService
5. C::LXDeviceGetService
6.
7. when DeviceStateService
8. C::LXDeviceStateService
View compose_ring.rb
#!/usr/bin/env ruby
require 'pry'
require 'pathname'
if ARGV.count != 3
puts "usage: #{__FILE__} <TEMPLATE_IMAGE> <SOURCE_DIR> <DEST_DIR>"
exit(1)
end
View invert_rings.rb
#!/usr/bin/env ruby
require 'pry'
require 'pathname'
if ARGV.count != 3
puts "usage: #{__FILE__} <TEMPLATE_IMAGE> <SOURCE_DIR> <DEST_DIR>"
exit(1)
end
@tatey
tatey / gist:c5482ab8ea3ef24e6191
Created Jan 23, 2015
Ruby wrapper for public Nest API
View gist:c5482ab8ea3ef24e6191
require 'excon'
require 'json'
require 'uri'
module NestAPI
VERSION = '0.0.1'
class Default
def initialize(token)
@token = token
@tatey
tatey / Makefile
Created Oct 18, 2014
Simple alternative to gulp
View Makefile
BIN = ./node_modules/.bin
all: css js html
css:
mkdir -p build/
$(BIN)/node-sass css/index.css.sass -o build/index.css
js:
mkdir -p build/
View appear.js.coffee
app = angular.module 'dashboard'
app.animation '.appear', [->
addClass: (element, className, done) ->
$element = jQuery element
$element.removeClass className
$element.css 'opacity', 1
$element.animate {opacity: 0}, 300, 'linear', ->
$element.addClass className
done()
You can’t perform that action at this time.