Skip to content

Instantly share code, notes, and snippets.

View pyro2927's full-sized avatar
💭
I may be slow to respond.

Joseph Pintozzi pyro2927

💭
I may be slow to respond.
View GitHub Profile
{
"kernelId": "AwXmwm1rAQAAgj-kxOkWwePDznqOm2K4VXsWjdYPLfd1G6IhhVtvadKxFUjLAawUFfEX2nzANeQO8YLqosIO8Q==",
"maxUpdateInterval": 2.88E7,
"kernel": "(function(a){var b={},c={};var d=Date.bind,e=Date.call,f=e.bind(d,e),g=f(Date.apply),h=[].push,i=[].pop,j=[].slice,k=[].splice,l=f(h),m=f(j),n=f([].join),o=f([].map),p=f({}.hasOwnProperty),q=JSON.stringify,r=Object.getOwnPropertyDescriptor,s=Object.defineProperty,t=String.fromCharCode,u=Math.min,v=Math.floor,w=ReferenceError,x=TypeError,y=Object,z=RegExp,A=Number,B=String,C=Array,D=f(\"\".indexOf),E=f(\"\".charAt),F=typeof Uint8Array===\"function\"?Uint8Array:Array;var G=[\"83\",\"GvofXSuCQKLhBq0gMrw\",\"MDSRjoIguRE2yDmtphceP7cK1Em7N9qUhs9Iwt1Yk3ucY6Y\",\"feFJTWD6QdPDHvR_S8vZ5g\",\"48\",\"JsQGVSHwddfuQqFOTNjmsmTyfqRo7Q9o\",\"Ny-b2eRpoAIk0y-x1UABMvcVjDb1YY3Mz8o\",\"dU30vst_pAdTqnDIni5bVKg\",\"a5RJMDTnJsikNpFLV53G-im_Dt4t\",\"E3iUz8MlqHI83AyFvVI\",\"nxrzl48anA\",\"addEventListener\",\"WXuR8pZu1w\",\"uwb2sOsftChTsk4\",\"31\",\"1JdbAhHoKg\",\"ffkBXgP4eumXWqVvSczBtwPY
/*
* Pyro's Layout
*/
#include "keymap_common.h"
#ifdef KEYMAP_SECTION_ENABLE
const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
#else
const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
config.add_setting :ldap_server
config.before(:suite) do
RSpec.configuration.ldap_server = Ladle::Server.new(quiet: true, ldif: File.expand_path("../files/seed.ldif", __FILE__), domain: "dc=evolvehq-test,dc=com", tmpdir: "/tmp")
RSpec.configuration.ldap_server.start
end
config.after(:suite) do
RSpec.configuration.ldap_server.stop unless RSpec.configuration.ldap_server.nil?
end
import string
def scaryDict(filename):
inFile = open(filename)
outFile = open('dictonary.txt', 'w') #find universal solution
content = inFile.read()
content = ''.join([c for c in content.lower() if c in (string.letters + string.whitespace) ])
words = sorted(set(content.split()))
for word in words:
if len(word) <= 2:
words.remove(word)
@pyro2927
pyro2927 / DismissiveEditText.java
Created October 9, 2014 19:58
I just want 'enter' to dismiss the keyboard :(
public class DismissiveEditText extends EditText implements View.OnKeyListener, TextView.OnEditorActionListener {
public DismissiveEditText(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
public DismissiveEditText(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
@pyro2927
pyro2927 / esxi_to_istat.py
Last active August 29, 2015 14:06
Middle-layer to present ESXi vCenter monitoring stats in Bjango's iStat2
## converting ESXi stats to iStat stats
## passed via XML on a TCP connection over port 5109
## example XML at:
## https://github.com/threez/istat/blob/master/spec/frames/measurement_request_spec.rb#L14
## Main things to go after:
#
# CPU usage, id, user, system, nice
# LOAD
# MEMORY usage, wired, active, inactive, free, total, swap used, swap_total, page_ins, page_outs
@pyro2927
pyro2927 / ubuntu_istatd.sh
Last active August 29, 2015 14:06
Ubuntu server istatd install
# install istatd on a fresh Ubuntu server
# expects to be run as root
# run automatically with `curl -sSL https://gist.githubusercontent.com/pyro2927/b18268834dccabf6b6d9/raw/9070d28d0cfb842b1cae33097cc9b47ce141059e/ubuntu_istatd.sh | bash`
apt-get install -y build-essential autoconf automake checkinstall libxml2-dev
wget https://github.com/tiwilliam/istatd/archive/r0.5.8.tar.gz
tar xvzf r0.5.8.tar.gz
cd istatd-r0.5.8/
autoreconf -i
./configure
make
@pyro2927
pyro2927 / Spot.groovy
Last active August 29, 2015 14:04
SmartThings Spot Controller
/**
* Spot
*
* SmartThings device type attempting to integrate with https://github.com/minton/Spot
*
* Copyright 2014 Joseph Pintozzi
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
@pyro2927
pyro2927 / Vagrantfile
Created July 31, 2014 15:13
rails_vagrant_file
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "eduardodeoh/precise64-rails-dev"
# Create a private network, which allows host-only access to the machine
# using a specific IP.