Skip to content

Instantly share code, notes, and snippets.

ruby_block "create services" do
block do
service_res = Chef::Resource::Service.new service_name, run_context
service_res.provider Chef::Provider::Service::Upstart
service_res.supports status: true, restart: true, reload: true
service_res.subscribes :restart, "deploy_revision[#{service_name}]", :delayed
service_res.run_action :enable
end
action :run
end
@smoak
smoak / _form.html.erb
Created November 13, 2014 22:53
Rails select form helper with has_many through
<%= form_for(@patient) do |f| %>
<% if @patient.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@patient.errors.count, "error") %> prohibited this patient from being saved:</h2>
<ul>
<% @patient.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
@smoak
smoak / output
Created September 25, 2014 17:40
Trying to create a test case for missing a slash when dealing with engines.
$ ruby test_case_missing_slash.rb
Run options: --seed 62773
# Running:
D, [2014-09-25T10:40:05.782387 #7511] DEBUG -- :
D, [2014-09-25T10:40:05.782441 #7511] DEBUG -- :
I, [2014-09-25T10:40:05.782843 #7511] INFO -- : Started GET "/test" for 127.0.0.1 at 2014-09-25 10:40:05 -0700
F, [2014-09-25T10:40:05.783768 #7511] FATAL -- :
RuntimeError (Could not find root path for #<TestEngine1::Engine:0x007f3beee14110>):
@smoak
smoak / gist:6499344
Created September 9, 2013 18:10
My vimrc
call pathogen#infect()
set nocompatible
set autoindent
set modelines=5
syntax on
filetype plugin indent on
set background=dark
set number
set tabstop=2
set shiftwidth=2
<?xml version="1.0" encoding="utf-8"?>
<my.custom.package.AwesomeWidget
android:id="@+id/widget"
...
...
/>
@smoak
smoak / dota2_linux_gdb.txt
Created July 11, 2013 05:49
dota 2 test linux
Single stepping until exit from function main,
which has no line number information.
Running a benchmark to measure system clock frequency...
Finished RDTSC test. To prevent the startup delay from this benchmark, set the environment variable RDTSC_FREQUENCY to 2294.000000 on this system. This value is dependent upon the CPU clock speed and architecture and should be determined separately for each server. The use of this mechanism for timing can be disabled by setting RDTSC_FREQUENCY to 'disabled'.
[New Thread 0xf738db40 (LWP 12016)]
[New Thread 0xf728cb40 (LWP 12017)]
[New Thread 0xf4e3bb40 (LWP 12024)]
SDL video target is 'x11'
SDL failed to create GL compatibility profile (whichProfile=0!
This system supports the OpenGL extension GL_EXT_framebuffer_object.
@smoak
smoak / PKGBUILD
Created June 28, 2013 20:56
PKGBUILD for cortex-git
# Contributor: Lucas de Vries <lucas@glacicle.org>
# Contribute: Scott Moak <scott.moak@mybrainoncode.com>
pkgname=cortex-git
_gitname=cortex
pkgver=7b29ca0
pkgrel=1
pkgdesc="An ncurses reddit browser and monitor"
license=('WTFPL')
arch=('i686' 'x86_64')
url="http://cortex.glacicle.org/"
@smoak
smoak / steam system info
Created June 23, 2013 02:28
Steam system info
Processor Information:
Vendor: GenuineIntel
Speed: 2301 Mhz
8 logical processors
4 physical processors
HyperThreading: Supported
FCMOV: Supported
SSE2: Supported
SSE3: Supported
SSSE3: Supported
@smoak
smoak / PKGBUILD
Last active December 15, 2015 11:58 — forked from saik0/PKGBUILD
# Maintainer: Jakub Schmidtke <sjakub-at-gmail-dot-com>
# Contributor: Joel Pedraza <joel@joelpedraza.com>
pkgname=android-support
pkgver=r12
pkgrel=1
pkgdesc='Android Support Package'
arch=('any')
url="https://developer.android.com/sdk/compatibility-library.html"
license=('custom')
@smoak
smoak / gist:4043663
Created November 9, 2012 04:16
libgdx camera stuff
@Override
public void show() {
map = TiledLoader.createMap(Gdx.files.internal("tiles/tiles3.tmx"));
atlas = new SimpleTileAtlas(map, Gdx.files.internal("tiles/"));
tileMapRenderer = new TileMapRenderer(map, atlas, 64, 64, 5, 5);
font = new BitmapFont();
font.setColor(Color.RED);
batch = new SpriteBatch();
// my world units are tiles