Skip to content

Instantly share code, notes, and snippets.

View njt1982's full-sized avatar
Converting Coffee into Code

Nicholas Thompson njt1982

Converting Coffee into Code
View GitHub Profile
@iamdbc
iamdbc / logrotate-puma-rails
Last active September 20, 2023 14:57
logrotate for puma on rails
# file location: /etc/logrotate.d
/home/deploy/app/your-app/shared/log/*.log {
daily
missingok
rotate 14
compress
delaycompress
dateext
notifempty
@blackice2999
blackice2999 / menu-local-task.html.twig
Created August 3, 2015 10:52
Drupal 8 - How to add classes to link (render array) without using preprocess....
{#
/**
* @file
* Default theme implementation for a local task link.
*
* Available variables:
* - attributes: HTML attributes for the wrapper element.
* - is_active: Whether the task item is an active tab.
* - link: A rendered link element.
*
@njt1982
njt1982 / clean-settings.sh
Created January 7, 2015 12:38
Drupal - Make Clean Settings.php file
#!/bin/sh
grep -vE '^(#|\/| \*)' default.settings.php | sed '/^\s*$/d' > settings.php
@lopopolo
lopopolo / gist:9427762
Created March 8, 2014 09:19
Relink all homebrew formulae after Mavericks upgrade
▶ brew list -1 | while read line; do brew unlink $line; brew link $line; done
Unlinking /usr/local/Cellar/appledoc/2.2... 0 links removed
Linking /usr/local/Cellar/appledoc/2.2... 1 symlinks created
Unlinking /usr/local/Cellar/autoconf/2.69... 0 links removed
Linking /usr/local/Cellar/autoconf/2.69... 18 symlinks created
Unlinking /usr/local/Cellar/bash-completion/1.3... 184 links removed
Linking /usr/local/Cellar/bash-completion/1.3... 182 symlinks created
Unlinking /usr/local/Cellar/bgrep/0.2... 0 links removed
Linking /usr/local/Cellar/bgrep/0.2... 1 symlinks created
Unlinking /usr/local/Cellar/binutils/2.24... 49 links removed
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
@njt1982
njt1982 / nginx configure
Created September 11, 2013 09:03
My nginx configuration
./configure --user=nginx --group=nginx --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --with-openssl=/usr/local/src/openssl-0.9.8l/ --with-openssl-opt="enable-tlsext" --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_geoip_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_perl_module --with-file-aio --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --with-ld-opt=-Wl,-E
@q0rban
q0rban / pull-requests
Last active December 20, 2015 13:59
Nginx Pull Requests config
server {
listen 0.0.0.0:80;
# Sniffs for domains of the format
# pr.[project-id].[pull-request-id].example.com, e.g.
# pr.lullabot_com.387.example.com. The project id must be only alphanumeric
# and underscores or hyphens.
server_name ~^pr\.(?<project>[a-zA-Z_-]*)\.(?<pull_request_id>[0-9]*)\.example\.com$;
## Access and error logs.
access_log /var/log/nginx/pr.$project.access.log;
@juampynr
juampynr / mymodule.info
Last active June 9, 2023 21:53
Drupal 7 Views 3 custom field handler
dependencies[] = ctools
; Views Handlers
files[] = views/mymodule_handler_handlername.inc
@cobyism
cobyism / gh-pages-deploy.md
Last active May 3, 2024 19:07
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@q0rban
q0rban / jenkins_log_parser_drush
Created December 7, 2012 21:04
Jenkins Drush Log Parser rules
warning /\[warning\]/
error /\[error\]/
info /\[completed\]/
info /\[success\]/
info /\[ok\]/
error /Processed 0/