Skip to content

Instantly share code, notes, and snippets.

View danielnolan's full-sized avatar

Daniel Nolan danielnolan

View GitHub Profile
@danielnolan
danielnolan / bin-dev
Created June 30, 2023 12:47
Use overmind vs foreman if available in rails bin/dev
#!/usr/bin/env bash
if command -v overmind &> /dev/null
then
overmind start -f Procfile.dev "$@"
exit $?
fi
if ! foreman version &> /dev/null
then
@danielnolan
danielnolan / git-rebase.markdown
Last active January 28, 2019 15:36 — forked from lgmkr/git-rebase.markdown
Git rebase workflow

Checkout a new working branch

 git checkout -b <branchname>

Make Changes

 git add
 git commit

Update branch

 git checkout <branchname>

git rebase origin/develop

@danielnolan
danielnolan / SassMeister-input-HTML.html
Created February 9, 2016 15:27
Generated by SassMeister.com.
<p class="foo">Foo</p>
<p class="bar">Bar</p>
@danielnolan
danielnolan / gist:9003127
Last active August 29, 2015 13:56
doesn't make sense
#mine
def self.keyword_search_mobile(attributes={}, user_attributes={}, offset = nil, limit = nil)
scope = []
if !attributes[:search].blank?
search = attributes.with_indifferent_access[:search]
scope = self.all(
:conditions => [
"short_desc ~* ? OR keywords ~* ? OR title ~* ?",
/\y#{search}\y/, /\y#{search}\y/, /\y#{search}\y/
]
@danielnolan
danielnolan / sidekiq.conf
Last active January 2, 2016 11:59
Sidekiq Upstart
description "Sidekiq Background Worker"
start on filesystem
stop on runlevel [06]
respawn
respawn limit 3 30
# change to match your deployment user
setuid deploy
@danielnolan
danielnolan / nginx.conf
Created December 4, 2013 00:24
Ubuntu Nginx Upstart Script
### Nginx upstart script
### source: http://serverfault.com/a/391737/70451
### /etc/init/nginx.conf
description "nginx http daemon"
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
env DAEMON=/etc/nginx/sbin/nginx
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
worker_rlimit_nofile 8192;
events {
worker_connections 8000;
}
@danielnolan
danielnolan / gist:1012315
Created June 7, 2011 14:03
Performanced Optimized CAKEPHP ACL Schema
/* ACL Tables */
CREATE TABLE acos (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
parent_id INT DEFAULT NULL,
model VARCHAR(255) DEFAULT '',
foreign_key INT UNSIGNED DEFAULT NULL,
alias VARCHAR(255) DEFAULT '',
lft INT DEFAULT NULL,
rght INT DEFAULT NULL