Skip to content

Instantly share code, notes, and snippets.

View kevinquillen's full-sized avatar

Kevin kevinquillen

View GitHub Profile
@hans2103
hans2103 / .htaccess-mod_headers
Created April 13, 2015 08:33
.htaccess rules to set cache control.
<IfModule mod_headers.c>
Header set Connection keep-alive
# Cache-control headers
# 2 HOURS
#<filesMatch "*">
Header set Cache-Control "max-age=7200, must-revalidate"
#</filesMatch>
# 480 weeks - 290304000
@rgoodie
rgoodie / new-drupal-dev-vm.sh
Last active March 22, 2018 23:47
A function, when added to bash profile, clones the Vagrant Drupal-Dev-VM (https://github.com/geerlingguy/drupal-dev-vm), augments configuration (based on d7 or d8), renames the VM to something other than drupaltest.dev and starts vagrant up. Uses include <newd 7 my-drupal-site> and <newd 8 my-other-drupal-site>.
# new drupal vagrant install
# A function, when added to bash profile, clones the Vagrant Drupal-Dev-VM (https://github.com/geerlingguy/drupal-dev-vm),
# augments config (based on d7 or d8), renames the VM to something other than drupaltest.dev and starts vagrant up. Uses
# include <newd 7 my-drupal-site> and <newd 8 my-other-drupal-site>.
function newd {
if [ $2 == ]; then
echo 'USAGE: newd8 <version> <sitename>'
@emilsoman
emilsoman / tmux-layout.md
Created August 31, 2014 21:49
Easy tmux layouts for tmuxinator

Tmux layouts with tmuxinator

Finally this time, I'm sold on tmux after I used tmuxinator to configure tmux layouts. The default layout didn't work for me, I wanted more control on the split panes. Here's how you can fine tune your tmux layout:

  1. Add this to your ~/.tmux.conf -> set -g mouse-resize-pane on
  2. Start tmux, split panes, resize panes with mouse to your liking
  3. On your shell, run tmux list-windows to list active tmux windows and their layouts
  4. Copy paste the layout in tmuxinator project file
@ethanhinson
ethanhinson / gluecode.php
Last active August 29, 2015 14:02
SOLR Views Code
<?php
/**
* Implements hook_views_query_alter().
*
* Integrates solr index search facets with select displays of the vr search
* views in order to allow views built on normal views base tables (not search API)
* to interact with SOLR for facet generation. This is perhaps not the most
* efficient approach, but provides a solution allowing the full extent of
* normal views base table fields, filters and sorts to be used in conjunction
* with SOLR facets.
@ungoldman
ungoldman / curl_post_json.md
Last active April 15, 2024 14:46
post a JSON file with curl

How do you POST a JSON file with curl??

You can post a json file with curl like so:

curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION

so for example:

@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active April 2, 2024 14:57
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@benfrain
benfrain / post-receive.sh
Last active October 30, 2023 15:55
post-receive hook for multiple branches
#!/bin/bash
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
if [ "master" == "$branch" ]; then
git --work-tree=./path/under/root/dir/live-site/ checkout -f $branch
echo 'Changes pushed live.'
fi
@kevinquillen
kevinquillen / README.md
Created June 2, 2013 21:25
Reddit Widget for Dashing

Preview

Description

Took a little inspiration from the News widget to construct this Reddit widget. Simply add the subreddit .json feed URLs that you want to the top of the reddit.rb job script, and the widget will cycle through each one, showing top posts, their score, and comment count. You can also set the maxcount higher or lower, the default is 5 posts.

##Usage

@sterlingwes
sterlingwes / tourney.html
Created December 3, 2012 23:42
Tournament Bracket Generator (Javascript + CSS, no tables)
<!DOCTYPE html>
<html>
<head>
<title>Tournament Bracket Generator</title>
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://underscorejs.org/underscore-min.js"></script>
<script>
$(document).on('ready', function() {
var knownBrackets = [2,4,8,16,32], // brackets with "perfect" proportions (full fields, no byes)
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a