Skip to content

Instantly share code, notes, and snippets.

module Kernel
alias_method :old_autoload, :autoload
def autoload symbol, file
require file
end
end
@timmow
timmow / Notes.md
Last active December 28, 2015 15:59
  • need the internal network to check code out / run composer at least - no way around this
  • very slow on non ssd macs - Ignacio has a newer machine so is low on the list for SSD upgrades, but vagrant is still slow.
  • Admin access seems to be required - issues when people run on an AD account. If we are going to run vagrant, we need to let people know the best way is to run vagrant in an admin non AD account
  • NFS still proving problematic - firewall rules possibly not quite working, but difficult to test. Running the required rule as admin did seem to work.
  • if we dont have shared folders from host, code checkouts not persistent after doing vagrant destroy
  • Jordis laptop is 32bit - I swear i've run it on a windows laptop, we must have some 32bit and some 64bit
  • nscd issue with resolv.conf - after provisioning it run nscd restart to prevent this
  • resolv.conf is getting overwritten - may be to do with vagrant halt. All our services rely on the correct resolv.conf being present. Solution is to e
<?php
use Composer\Repository\Vcs\GitDriver;
use Composer\IO\NullIO;
use Composer\Config;
use Composer\Factory;
require_once 'vendor/autoload.php';
$a = new GitDriver(
array('url' => 'git://digital-gitmirror-01/symfony/pluginCommon/'),
> puppet apply test.pp
notice: test main
notice: /Stage[main]//Test[blah]/Notify[test main]/message: defined 'message' as 'test main'
notice: test2 blah
notice: /Stage[main]//Test[blah]/Test2[bleh]/Notify[test2 blah]/message: defined 'message' as 'test2 blah'
@timmow
timmow / gist:6672546
Last active December 23, 2015 17:59
TR queries
SELECT r.id AS r__id, r.created_sf_guard_user_id AS r__created_sf_guard_user_id, r.author_id AS r__author_id, r.published_at AS r__published_at, r.teaser_web AS r__teaser_web, r.teaser_newsletter AS r__teaser_newsletter, r.verdict AS r__verdict, r.product_id AS r__product_id, r.award_recommended AS r__award_recommended, r.award_editors_choice AS r__award_editors_choice, r.with_photos_tab AS r__with_photos_tab, r.first_look AS r__first_look, r.review_type AS r__review_type, r.overall_score AS r__overall_score, r.comments_id AS r__comments_id, r.review_price AS r__review_price, r.reviewed_at AS r__reviewed_at, r.adtech_keywords AS r__adtech_keywords, r.last_synced AS r__last_synced, r.standout_url AS r__standout_url, r.created_at AS r__created_at, r.updated_at AS r__updated_at, r.is_published AS r__is_published, r.publish_start AS r__publish_start, r.publish_end AS r__publish_end, a.id AS a__id, a.name AS a__name, a.created_at AS a__created_at, a.updated_at AS a__updated_at, p.id AS p__id, p.page_title AS p__pa
5.times do
puts "blah"
end
@timmow
timmow / gist:5626983
Created May 22, 2013 11:49
Add a custom fact for a hostname in a vagrantfile
config.vm.provision :puppet do |puppet|
puppet.facter = {
"hostname" => `hostname`.strip
}
end
@timmow
timmow / pow.md
Last active December 13, 2015 20:08
Very simple static websites on osx with pow and powder

Intro

Often you want to test out some simple static http / css / js code in your local environment. You could setup mass virtual hosting and dnsmasq with a wildcard domain to serve *.dev, but for purely static files, I find this is an easier setup. And there is less overhead, as pow spins up nodejs to serve a request rather than constantly having apache run in the background.

Pow

Pow is a zero-configuration Rack server for Mac OS X. You can install it with homebrew

brew install pow
@timmow
timmow / program
Created February 11, 2013 13:06
Enable symlinking of an executable, into a systemwide bin directory if you want to manage things without rubygems
#!/bin/env ruby
if File.symlink?( __FILE__)
dir = File.dirname(File.readlink(__FILE__))
$:.push( dir + '/lib')
Dir.chdir(dir)
end
@timmow
timmow / gist:4701954
Created February 3, 2013 14:13
Remove a lame gem, from
perl -n -i -e 'print unless /lame/' Gemfile