Skip to content

Instantly share code, notes, and snippets.

@jaredbeck
jaredbeck / automatic_constructor.cfc
Last active December 10, 2015 06:08
Constructors in ColdFusion
component {
if (NOT StructKeyExists(this, 'initialized') OR this.initialized EQ false) {
init();
}
public void function init() {
this.foo = 'bar';
this.initialized = true;
}
}
@jaredbeck
jaredbeck / gist:4156939
Created November 27, 2012 20:53
Using CURL to make a SOAP request against PFAPI 1.1

Given a file with a SOAP request ...

$ cat cupa_request.xml
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <q1:unit_fetch xmlns:q1="http://v1_1.v.pfapi.remote_api">

cupahr_remote

@jaredbeck
jaredbeck / gist:3962196
Created October 26, 2012 23:34
I heard you like Mountain Lions

I heard you like Mountain Lions

Incompatibles

@jaredbeck
jaredbeck / keeping_server_sw_up_to_date.md
Created October 2, 2012 19:59
Keeping server software up to date

Keeping Server Software Up To Date

The Stack

  1. OS
  2. Managed Packages
  3. Unmanaged Packages
  4. Application Frameworks
@jaredbeck
jaredbeck / gist:3649592
Created September 6, 2012 01:23
Upgrading ruby on ggchapters.org

Trying to update ruby on ggchapters.org from 1.8.6 to 1.8.7

Jared Beck, 2012-09-05

  1. Couldn't deploy because bundler says: gem says: sass "requires ruby >= 1.8.7"

  2. Confirmed that production host was running 1.8.6

     $ dpkg --get-selections | grep ruby
    

ruby1.8 install

@jaredbeck
jaredbeck / gist:3148368
Created July 20, 2012 02:51
Disable rspec verbosity
# Turn off rspec verbosity, so that the
# resultant rspec command, and all the
# spec names, are not echoed to stdout.
# See http://bit.ly/MoOoB3 -Jared 2012-07-19
if defined? RSpec
task(:spec).clear
RSpec::Core::RakeTask.new(:spec) do |t|
t.verbose = false
end
end
@jaredbeck
jaredbeck / gist:2991733
Created June 25, 2012 22:19
Someone turned off autovacuum
[postgres@db1 data]$ diff postgresql.conf /usr/local/src/pf/config/postgres/db1/postgresql.conf
367c367
< #track_counts = on
---
> track_counts = on
386c386
< #autovacuum = on # Enable autovacuum subprocess? 'on'
---
> autovacuum = on # Enable autovacuum subprocess? 'on'
@jaredbeck
jaredbeck / gist:2409011
Created April 17, 2012 20:58
sass-convert fail
-thead, thead th {
- vertical-align: bottom; /* derp */
-}
+thead {
+ vertical-align: bottom;
+ /* derp */
+ th {
+ vertical-align: bottom;
+ /* derp */ } }
@jaredbeck
jaredbeck / gist:2409007
Created April 17, 2012 20:57
sass-convert win
-a:link {
- color: #36C;
-}
-a:visited {
- color: #36C;
-}
+a {
+ &:link, &:visited {
+ color: #36C; } }
@jaredbeck
jaredbeck / gist:2130728
Created March 20, 2012 03:16
brew ls --unbrewed
apache2/bin/ab
apache2/bin/apachectl
apache2/bin/apr-1-config
apache2/bin/apu-1-config
apache2/bin/apxs
apache2/bin/checkgid
apache2/bin/dbmmanage
apache2/bin/envvars
apache2/bin/envvars-std
apache2/bin/htcacheclean