Skip to content

Instantly share code, notes, and snippets.

View jonpugh's full-sized avatar

Jon Pugh jonpugh

View GitHub Profile
@derhasi
derhasi / build.sh
Last active October 14, 2019 13:43
#!/usr/bin/env bash
set -e
# Create build commit by pulling the remote branch and copying over the files from the project build
# which contain data in the docroot we usually do not commit.
LAST_COMMIT_INFO=$(git log -1 --pretty="[%h] (%an) %B")
LAST_COMMIT_USER=$(git show -s --format="%an")
LAST_COMMIT_USER_EMAIL=$(git show -s --format="%ae")
CURRENT_REV=$(git rev-parse --abbrev-ref HEAD)
# We store directory values, so we can restore them later.
@andyshinn
andyshinn / composer.json
Last active February 18, 2024 12:05
Docker Compose PHP Composer Example
{
"require": {
"mfacenet/hello-world": "v1.*"
}
}
@yang-wei
yang-wei / note.md
Last active April 19, 2021 14:49
Vue.js tips and tricks

Notes: All the examples below are only tested on Vue.js 1.0 (above).

Notes: The examples below use ES6 so it's recommended to use browserify or webpack to easily integrate babel.

when or where can we use this.$el

When you need to access DOM attribute, be careful with the lifecycle. Vue.js has a few useful lifecycle hooks.

Let's say we want to scroll our component to the bottom (imagine it's a long list with overflow-y: auto) once it's instantiate.

@stephanetimmermans
stephanetimmermans / ubuntu-compass-ruby
Last active May 16, 2024 03:29
Install Compass+Ruby on Ubuntu 14.04
#https://gorails.com/setup/ubuntu/14.04
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.2
rvm use 2.1.2 --default
@juampynr
juampynr / upgradepath.drush.inc
Last active December 30, 2015 05:48
Drupal 7's upgrade path
<?php
// NOTE This has been moved to https://www.drupal.org/project/upgradepath
/**
* @file
* Runs a set of steps to upgrade a database to be in line with code.
*/
/**
* Implements hook_drush_command().
@q0rban
q0rban / jgd_pull_request_builder.sh
Created December 7, 2012 20:53
Example Job for Jenkins Github Drupal Pull Request Builder
#!/usr/bin/env bash
set -e
# Jenkins job script for use with the Jenkins Github Drupal, which can be found
# at https://github.com/Lullabot/jenkins_github_drupal. NOTE, all shell scripts
# have been symlinked to /usr/local/bin to make them easier to call here. For
# example:
# ln -s /usr/local/share/jenkins_github_drupal/prepare_dir.sh \
# /usr/local/bin/jgd-prepare-dir
@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:

@greggles
greggles / webform.drush.inc
Created May 7, 2012 15:53
example drush sanitize hook
<?php
function paranoia_drush_sql_sync_sanitize($source) {
drush_sql_register_post_sync_op('webform_delete_webform_submissions',
dt('Delete all webform_submission primary entries'),
"delete from webform_submissions;");
drush_sql_register_post_sync_op('webform_delete_webform_submitted_data',
dt('Delete all webform_submitted_data field level entries'),
"delete from webform_submitted_data;");
}