Skip to content

Instantly share code, notes, and snippets.

@nelstrom
nelstrom / access-control-lists-on-osx.md
Last active December 9, 2023 23:29
Setting ACL on OS X

I have two user accounts set up on my mac. User drew I use for most things, but if I'm making a screencast I'll switch to the demo user. I know that the demo user has a clean desktop, and the font size is larger than usual in my terminal and text editors, making everything a bit more legible when capturing the screen. When I record a screencast as the demo user, I save the file to /Users/Shared/screencasts. As I understand it, the /Users/Shared directory is supposed to be accessible to all user accounts on the mac. If I created and saved a screenflow document as the demo user, I should be able to read and write that file when logged in as user drew.

That was the theory, but it didn't always work out that well in practice. I would occasionally find that a directory was only writable by one user or the other. Perhaps I'd open a screenflow document as user drew and attempt to export the video to the same directory, only to find that the directory was owned by demo, meaning that I couldn't cr

@dbu
dbu / Vagrantfile
Created November 13, 2012 09:26
vagrant setup
# -*- mode: ruby -*-
# vi: set ft=ruby :
this_dir = File.dirname(__FILE__) + "/"
require this_dir + "vagrant/hostmaster.rb"
Vagrant::Config.run do |config|
# define some colors for our output
def colorize(text, color_code) "#{color_code}#{text}\033[0m" end
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@juandazapata
juandazapata / mountain_lion_home_brew.md
Created July 26, 2012 15:07
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

After upgrading to Mountain Lion, I got this message when trying to run my local rails server:

Installing rmagick (2.13.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    Users/user/.rvm/rubies/ruby-1.9.3-rc1/bin/ruby extconf.rb
@avalanche123
avalanche123 / timeout.php
Created July 10, 2012 19:12
timeouts in php
<?php
class TimeoutException extends RuntimeException {}
class Timeout
{
private $active;
public function set($seconds)
{
@helios-ag
helios-ag / Capfile
Created May 7, 2012 10:46
Capifony fix to set file permissions on Ubuntu for [cache] and [logs] dirs
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/bundles/*/*/recipes/*.rb'].each { |bundle| load(bundle) }
load Gem.find_files('symfony2.rb').last.to_s
# Change ACL on the app/logs and app/cache directories
after "deploy:finalize_update" do
run "setfacl -R -m u:www-data:rwx -m u:#{user}:rwx #{latest_release}/#{cache_path} #{latest_release}/#{log_path}"
run "setfacl -dR -m u:www-data:rwx -m u:#{user}:rwx #{latest_release}/#{cache_path} #{latest_release}/#{log_path}"
end
@peterjmit
peterjmit / deploy.rb
Created April 10, 2012 13:45
Create a parameters.ini file interactively when deploying with capifony
# This custom task for deploying a Symfony 2 application is set to run after deploy:setup
# is executed. It interactively ask a user for database details to create a parameters.ini
# thus avoiding having to manually on to the server and create it
#
# Helper function from http://stackoverflow.com/a/1662001/1041885
#
# Interactive parameter.ini generation adapted from http://adurieux.blogspot.co.uk/2011/10/using-capistrano.html
# ...
# ... Your deployment settings/tasks
@justinkelly
justinkelly / _config.yml
Created March 21, 2012 01:17
Update posterous migrator for jekyll/octopress that maintains url slug
# To maintain your posterous links use the below permalink config
# ----------------------- #
# Jekyll & Plugins #
# ----------------------- #
permalink: /:title/
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@panicsteve
panicsteve / gist:1641705
Created January 19, 2012 18:26
Form letter template for acquired startups
Dear soon-to-be-former user,
We've got some fantastic news! Well, it's great news for us anyway. You, on
the other hand, are fucked.
We've just been acquired by:
[ ] Facebook
[ ] Google
[ ] Twitter