Skip to content

Instantly share code, notes, and snippets.

{
"ensure_newline_at_eof_on_save": true,
"font_size": 16.0,
"hot_exit": true,
"ignored_packages":
[
"Vintage"
],
"remember_open_files": false,
"rulers":
@bradgignac
bradgignac / dropdown.html
Created June 6, 2013 21:20
Menus without a target.
// You'll need to hardcode the width to display them without a target.
<div class="dropdown" style="width: 200px;">
<ul class="dropdown-menu visible">
<li><span class="dropdown-category">Category</span></li>
<li><a href="#">One</a></li>
<li><a href="#">Two</a></li>
<li>
<a href="#">This is a really long link <i class="icon-external"></i> <span class="dropdown-caption">And I have a caption.</a>
</li>
</ul>
{
"ensure_newline_at_eof_on_save": true,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"word_wrap": false
}
@bradgignac
bradgignac / create-server.rb
Created April 30, 2013 22:34
Create Server with Cloud Networks
compute = Fog::Compute.new(:provider => 'Rackspace', :version => 'v2')
server = compute.servers.new
server.name = 'test-networks'
server.flavor_id = compute.flavors.first.id
server.image_id = compute.images.first.id
server.save(:networks => [compute.networks.first.id])
@bradgignac
bradgignac / page_objects.rb
Created April 16, 2013 22:32
Page Objects
ServerListView.new(@selenium_driver)
class ServerListView < PageObject::Base
def initialize(element)
super(element, '#server_list_view')
end
def popover
CreateServerPopover.new(context)
# context.find_element(:css, '.btn-primary').click
@bradgignac
bradgignac / stacktrace
Last active December 11, 2015 15:48
Jenkins - GitHub Enterprise OAuth Error
Status Code: 500
Exception: no protocol: github.rackspace.com//user?access_token=REDACTED
Stacktrace:
java.net.MalformedURLException: no protocol: github.rackspace.com//user?access_token=REDACTED
at java.net.URL.<init>(URL.java:585)
at java.net.URL.<init>(URL.java:482)
at java.net.URL.<init>(URL.java:431)
at org.kohsuke.github.GitHub.getApiURL(GitHub.java:175)
at org.kohsuke.github.Requester._to(Requester.java:159)
#!bash
#
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
@bradgignac
bradgignac / create_image.rb
Created October 24, 2012 14:18
OpenStack Create Image
glance = Fog::Image.new(:provider => 'openstack', ...AUTH CREDENTIALS...)
image = glance.images.new
image.name = 'Some Name'
image.location = 'some_file_on_disk.iso'
image.save
@bradgignac
bradgignac / cpu.rb
Created September 27, 2012 21:07
CloudWatch
cloudwatch = Fog::AWS::CloudWatch.new(:aws_access_key_id => 'id', :aws_secret_access_key => 'key')
conditions = {
'Namespace' => "#{options[:namespace]}",
'Dimensions' => "#{options[:dimension]}",
'MetricName' => "#{options[:metric]}",
'Unit' => "#{options[:unit]}",
'Period' => "#{options[:period]}",
'Statistics' => "#{options[:stats]}",
'StartTime' => startTime,
@bradgignac
bradgignac / gist:3745836
Created September 18, 2012 20:54 — forked from tripngroove/gist:3718494
Fluid width popover labels
<html>
<head>
<style>
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; padding:0; margin:0; }
body, input, textarea, select,ul,li { font:13px/20px Arial, sans-serif; color:#333; }
.page { width:800px; margin:0 auto; padding:30px; }
.popover { border:1px solid #ccc; display:inline-block; padding:20px; box-shadow:2px 2px 10px rgba(0,0,0,0.25); }
.table { display:table; }
.row { display:table-row; }
.cell { display:table-cell; padding-bottom:20px; }