Skip to content

Instantly share code, notes, and snippets.

Avatar

Levi Wilson leviwilson

View GitHub Profile
View poor_mans_vpn.md

Poor Man's VPN

Create an AWS EC2 Linux Instance

  1. Sign into your AWS account console
  2. Choose an availability zone not in your area (like Oregon or something)
  3. Launch a new instance (just choose an Ubuntu instance). A t2.micro should be fine for this.
  4. You may have to create a new key pair if you haven't already. Name it and the download the file. Do not lose this as this <whatever>.pem file is what you'll use to access the instance.

SSH Tunnel Into It

Now that you have an EC2 instance running in some other area of the country, you will want to SSH tunnel into

View meaning_cloud.rb
require 'faraday'
require 'dotenv'
require 'json'
module MeaningCloud
def self.topics(options)
request :topics, options, lang: 'en', tt: 'ecr'
end
def self.sentiment(options)
View controller.js
myapp.controller('myController', ['myService', function (myService) {
$scope.autofillSearch; //Input field in HTML
$scope.findAutofill = function () {
myService.autofill($scope.autofillSearch)
.success(function (data) {
window.console.log('Yay! ' + data);
})
.error(function () {
window.console.log('BOOO!');
});
@leviwilson
leviwilson / README.md
Last active Aug 29, 2015
Kiwi Helper Class Question
View README.md

Background

Warning: I do not know objective-c that well

I'm working in some specs. Sometimes I see an opportunity to use some test helpers to eliminate some duplication in my testing. I'd like to be able to create a helper class that is able to wrap some of these helper verification methods and re-use it to clean up some of my specs.

Problem

I don't have access to any of the should flavor of Kiwi verifications within my tester. I'm assuming because I'm not within the SPEC_BEGIN / SPEC_END (as those macros call other Kiwi methods).

The Question

View object.rb
class Object
def kill_puppies(how_many)
sleep how_many
end
end
View keybase.md

Keybase proof

I hereby claim:

  • I am leviwilson on github.
  • I am leviwilson (https://keybase.io/leviwilson) on keybase.
  • I have a public key whose fingerprint is 3392 4A26 7AC8 21D5 9E80 802D 12C5 EA5D 4297 5CD8

To claim this, I am signing this object:

@leviwilson
leviwilson / .gitattributes
Created Feb 19, 2014
Default .gitattributes that the Git for Visual Studio plugin gives you.
View .gitattributes
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
View your_screen.rb
class YourScreen
include Mohawk
def press_enter
w = Uia.find_element handle: adapter.window.handle # get the top-level window for this screen
t = w.find id: 'yourTextFieldId'
t.send_keys :enter
end
end
@leviwilson
leviwilson / Gemfile
Last active Aug 29, 2015
mohawk / uia gem setup
View Gemfile
source 'http://rubygems.org'
# ...
gem 'mohawk', git: 'git://github.com/leviwilson/mohawk.git', branch: 'uia_gem'
gem 'uia', git: 'git://github.com/northwoodspd/uia.git'
# ...
View .gitattributes
*.csproj -text merge=union
*.sln -text merge=union