View mario_fart_mix_2.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using Sonic-Pi | |
samps = "/Users/technicalpickles/Dropbox/sonicpi-samples/" | |
##| use_bpm 120 | |
define :mario_waha do |options={}| | |
options ||= {} | |
sample samps, "mlpit_mario_waha.wav", options | |
end |
View whyunosleep.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
assertions = {} | |
lines = `pmset -g assertions`.lines.map {|line| line.chomp } | |
lines.each do |line| | |
# pid 329(Slack): [0x00004c1d00058b13] 24:48:54 NoDisplaySleepAssertion named: "Electron" | |
if line =~ /pid (\d+)\((.*)\): \[.*\] (\d+:\d+:\d+) (\w+) named: \"(.*)\"/ | |
pid = $1.to_i | |
application = $2 | |
date = $3 | |
assertion_type = $4 |
View monitor.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/setup' | |
require 'faraday' | |
require 'typhoeus' | |
require 'typhoeus/adapters/faraday' | |
require 'pry' | |
conn = Faraday.new do |faraday| | |
faraday.adapter :typhoeus | |
end |
View configuration.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group: | |
living_room_lights: | |
name: Living Room Lights | |
entities: | |
- light.living_room_lamp | |
living_room: | |
name: Living Room | |
view: yes | |
entities: |
View sleepiq.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from datetime import timedelta | |
from requests.exceptions import ConnectionError as ConnectError, \ | |
HTTPError, Timeout | |
from homeassistant.components.sensor import DOMAIN | |
from homeassistant.helpers import validate_config | |
from homeassistant.helpers.entity import Entity | |
from homeassistant.util import Throttle |
View icecast-admin.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'faraday' | |
require 'faraday_middleware' | |
module Icecast | |
class Admin < Faraday::Connection | |
class Error < RuntimeError | |
end | |
class AdminError < Error | |
end |
View it.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Description: | |
# Get help from @yourorg/it for your information technology problems. Oh by the way.... Your Welcome. | |
# | |
# Commands: | |
# hubot it me <problem> - get help from @yourorg/it about your information technology <problem> | |
module.exports = (robot) -> | |
robot.respond /it(?: me)?(?: (.*))?/i, (msg) -> | |
problem = msg.match[1] |
View inspector
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
for opt in $* ; do | |
case "$opt" in | |
--debug) hubot_debug="coffee --nodejs --debug";; | |
esac | |
done |
View gist:a4581caa9378549dd59d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def flaky_code() | |
unless @flaky_code_works | |
@flaky_code_works = true | |
raise 'wtf' | |
end | |
puts "works eventually lol" | |
end |
View gist:396a55d2c7198cd7090b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PostsController < ApplicationController | |
if ENV['HTTP_AUTH_USERNAME'].present? && ENV['HTTP_AUTH_PASSWORD'].present? | |
http_basic_authenticate_with name: ENV['HTTP_AUTH_USERNAME'], password: ENV['HTTP_AUTH_PASSWORD'] | |
def index | |
render plain: "Everyone can see me!" | |
end | |
end |
NewerOlder