This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* works around PHP's shitty floating point math to properly round numbers | |
* | |
* USE THIS EVERYWHERE BECAUSE FLOATS FUCKING SUCK | |
*/ | |
function super_round($number, $precision = 0) { | |
$power = bcpow(10, $precision); | |
$rounded = round(bcmul($number, $power, 1), 0); | |
return bcdiv($rounded, $power, $precision); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo mdutil -a -i off | |
sudo mdutil -a -i on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this file should be config/initializers/smtp.rb | |
config_file = File.join(Rails.root.to_s, '/config/smtp.yml') | |
if File.exists? config_file | |
if smtp_config = YAML.load_file(File.expand_path(config_file))[Rails.env] | |
MyApp::Application.config.action_mailer.delivery_method = :smtp | |
MyApp::Application.config.action_mailer.smtp_settings = smtp_config | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tmux detach | |
tmux has-session -t filament | |
if [ $? != 0 ] | |
then | |
tmux new-session -s filament -n editor -d | |
tmux send-keys -t filament 'cd ~/Sites/filament' C-m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# my problem is thus: | |
# I need to run the 'php::source' recipe before I run `pecl install yaml`, otherwise pecl isn't installed yet. | |
# My first attempts are going something like | |
include_recipe "php::source" | |
`pecl install yaml` # except this explodes because php::source hasn't been run *yet* | |
# So I tried getting rid of the include_recipe line and having a run list of: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
site "http://community.opscode.com/api/v1" | |
cookbook "1kb_workstation", | |
:git => "https://github.com/1000Bulbs/1kb_workstation.git" | |
cookbook "pivotal_workstation", | |
:git => "https://github.com/1000Bulbs/pivotal_workstation.git" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>io.redis.redis-server</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/local/bin/redis-server</string> | |
<string>/etc/redis/redis.conf</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: God | |
### END INIT INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[color] | |
branch = auto | |
diff = auto | |
status = auto | |
ui = true | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./configure --with-curl --with-config-file-path=/private/etc --with-mysqli --with-mysql --with-apxs2 --with-mcrypt --enable-soap --with-openssl --enable-zip --enable-bcmath --enable-mbstring --enable-sockets |
NewerOlder