Skip to content

Instantly share code, notes, and snippets.

View update-paths.lua
obs = obslua
os = require("os")
io = require("io")
relative_path_from_home = "Dropbox/Twitch Assets"
settings_path = ""
function refresh_button_clicked(props, p)
update()
end
View unifi-log-relay.rb
#!/usr/bin/env ruby
require 'socket'
LISTEN_PORT = 8514
DESTINATION_HOST = "xxxx.papertrailapp.com"
DESTINATION_PORT = xxxx
class SyslogRelay
PARSER = /^(<\d+>\S+\s+\S+\s+\S+) \("([^,]+),([^,]+),([^"]+)"\) ([^:]+): (.*)$/
@eric
eric / copy_librato_dashboard.rb
Last active Jul 15, 2016 — forked from jderrett/copy_librato_dashboard.rb
Copy Librato Dashboard from one account to another
View copy_librato_dashboard.rb
require 'faraday'
require 'faraday_middleware'
require 'json'
class DashboardApi
LIBRATO_API = 'https://metrics-api.librato.com'
LIBRATO_API_VERSION = 'v1'
ENDPOINT = [LIBRATO_API, LIBRATO_API_VERSION].join('/')
attr_accessor :username
View cond_test.go
package main
import (
"testing"
"sync"
"sync/atomic"
)
func TestOneBarrier(t *testing.T) {
expected := int32(2)
View META-INF-MANIFEST.MF
Manifest-Version: 1.0
Implementation-Vendor: net.lag
Implementation-Title: kestrel
Implementation-Version: 2.4.1
Implementation-Vendor-Id: net.lag
Class-Path: libs/scala-library.jar libs/ostrich-8.2.9.jar libs/scala-j
son-3.0.1.jar libs/util-core-5.3.13.jar libs/util-eval-5.3.13.jar lib
s/scala-compiler.jar libs/util-logging-5.3.13.jar libs/util-jvm-5.3.1
3.jar libs/naggati_2.9.2-4.1.0.jar libs/finagle-core-5.3.19.jar libs/
netty-3.5.5.Final.jar libs/util-collection-5.3.13.jar libs/jsr305-1.3
View gist:9354696
{"$id":"1","Error":"This salt has already been used in the last 8 hour period"}
@eric
eric / papertrail.coffee
Last active Jan 1, 2016
Work in progress Papertrail hubot plugin
View papertrail.coffee
# Description:
# Query logs from Papertrail
#
# Dependencies:
# None
#
# Configuration:
# HUBOT_PAPERTRAIL_API_TOKEN - Papertrail API token
#
# Commands:
View scala_option.rb
class Option
end
class None < Option
def map(&block)
return None
end
end
class Some < Option
@eric
eric / bluebox.coffee
Last active Dec 25, 2015
Pipe all messages from BlueBox customer chat into Campfire
View bluebox.coffee
# Description:
# Providing ways to interact with bluebox
#
# Commands:
# hubot bluebox chat on - Enable chat transcripts
# hubot bluebox chat off - Disable chat trascripts
#
# Dependencies:
# "cookie": "0.1.0"
# "cheerio": "0.12.3"
View test_un_verbose.rake
namespace :test do
task :turn_off_verbose do
ObjectSpace.each_object(Rake::TestTask) { |t| t.verbose = false }
end
end
%w(test:units test:functionals test:integration).each do |task_name|
Rake::Task[task_name].prerequisites << 'test:turn_off_verbose'
end