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 "google_drive" | |
session = GoogleDrive.login("EMAIL_ADDRESS", "PASSWORD") | |
# Document key is the value found for the key param in the url | |
# ex: https://docs.google.com/spreadsheet/ccc?key=0Atoge9gLkMCTdHdza2FxTDliakNGamRXV01WYmNUUVE&usp=drive_web | |
# has a key of 0Atoge9gLkMCTdHdza2FxTDliakNGamRXV01WYmNUUVE | |
ws = session.spreadsheet_by_key("DOCUMENT_KEY").worksheets[0] | |
word_indexes = (3..8) # the rows in which your translated words exist |
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: | |
# Made so we can play Wheel of Fortune in Campfire | |
# | |
# Dependencies: | |
# None | |
# | |
# Configuration: | |
# None | |
# | |
# Commands: |
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
function FindProxyForURL(url, host) { | |
PROXY = "PROXY 127.0.0.1:8080; DIRECT" | |
// plex.tv via proxy | |
if (shExpMatch(host,"*.plex.tv")) { | |
return PROXY; | |
} | |
// Everything else directly! | |
return "DIRECT"; | |
} |
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
var listModelGraph = attrs.listModel.split('.'); | |
$scope.valueArray = _.reduce(listModelGraph, function (scope, node) { return scope[node]; }, $scope); |
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
# -*- 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. |
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
/** | |
* 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: | |
* |
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
# 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 |
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
## 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 |
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
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(); | |
} |
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 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) |