Skip to content

Instantly share code, notes, and snippets.

@StlTenny
StlTenny / test.rb
Last active October 30, 2015 11:18
require ‘net/http’
require ‘cgi’
class StatusMessage
attr_accessor :status, :status_endpoint
end
def whyrun_supported?
true
end
@StlTenny
StlTenny / Screen Output
Created October 15, 2013 20:29
Vim Slime Output
2.0.0-p195 :002 > first = "This is a test"
=> "This is a test"
2.0.0-p195 :003 > second = " to see if our slimey screen works"
=> " to see if our slimey screen works"
2.0.0-p195 :004 > third = first + second
=> "This is a test to see if our slimey screen works"
2.0.0-p195 :005 > puts third
This is a test to see if our slimey screen works
=> nil
2.0.0-p195 :006 >
@StlTenny
StlTenny / screentest.rb
Created October 15, 2013 20:01
Vim/Slime/Screen Test
first = "This is a test"
second = " to see if our slimey screen works"
third = first + second
puts third
@StlTenny
StlTenny / gist:5834019
Created June 21, 2013 20:16
OSX Maverick Config gist
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure --prefix=/Users/thinds/.rvm/rubies/ruby-1.9.3-p429 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libxml2:/usr/local/opt/libxslt:/usr/local/opt/libksba:/usr/local/opt/openssl --disable-install-doc --without-tcl --without-tk --enable-shared
## --------- ##
## Platform. ##
@StlTenny
StlTenny / gist:5833878
Created June 21, 2013 19:58
OSX Maverick RVM install 1.9.3.
1.9.3 - install
Searching for binary rubies, this might take some time.
Remote file does not exist https://rvm.io/binaries/osx/10.9/x86_64/ruby-1.9.3-p429.tar.bz2
Remote file does not exist http://jruby.org.s3.amazonaws.com/downloads/ruby-1.9.3-p429.tar.bz2
Remote file does not exist http://binaries.rubini.us/osx/10.9/x86_64/ruby-1.9.3-p429.tar.bz2
rvm_remote_server_url3 not found
No remote file name found
No binary rubies available for: osx/10.9/x86_64/ruby-1.9.3-p429.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
__rvm_setup_compile_environment_setup ruby-1.9.3-p429
[
{ "keys": ["ctrl+tab"], "command": "next_view_in_group" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view_in_group" },
{ "keys": ["alt+tab"], "command": "next_group"},
{ "keys": ["alt+shift+tab"], "command": "prev_group"}
]
import sublime_plugin
class NextViewInGroup(sublime_plugin.WindowCommand):
def run(self):
currentGroup, currentViewIndex = self.window.get_view_index(self.window.active_view())
currentViews = self.window.views_in_group(currentGroup)
if currentViewIndex < len(currentViews) - 1:
newView = currentViews[currentViewIndex + 1]
else:
import sublime_plugin
class NextGroup(sublime_plugin.WindowCommand):
def run(self):
numGroups = self.window.num_groups()
currentGroup = self.window.active_group()
if currentGroup < numGroups - 1:
newGroup = currentGroup + 1
else:
Started POST "/customers/3/tabs" for 127.0.0.1 at Mon Jun 18 14:02:36 -0400 2012
Processing by TabsController#create as HTML
Parameters: {"commit"=>"Create Tab", "authenticity_token"=>"2bJBuyENTUg/lOLjU7s1WdCESTAYEFM/CroNCWFWAWE=", "customer_id"=>"3", "tab"=>{"is_open"=>"1", "current_price"=>"0", "closed_price"=>"0", "bar_id"=>""}, "utf8"=>"✓"}
SQL (0.5ms) INSERT INTO "tabs" ("bar_id", "closed_price", "created_at", "current_price", "customer_id", "is_open", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["bar_id", nil], ["closed_price", 0], ["created_at", Mon, 18 Jun 2012 18:02:36 UTC +00:00], ["current_price", 0], ["customer_id", nil], ["is_open", true], ["updated_at", Mon, 18 Jun 2012 18:02:36 UTC +00:00]]
Redirected to http://localhost:3000/tabs/4
Completed 302 Found in 12ms
#Tab Controller
def new
@StlTenny
StlTenny / gist:2938258
Created June 15, 2012 19:13
Small Script
<% [:error].each do |level| %>
<% unless flash[level].blank? %>
<script type="text/javascript">
$('#myModal').modal('show')
</script>
<% end %>