Skip to content

Instantly share code, notes, and snippets.

View kostajh's full-sized avatar

Kosta Harlan kostajh

View GitHub Profile
@kostajh
kostajh / bump_versions.py
Created February 23, 2012 15:29
bump versions
# bump_versions.py
# A simple script to bump version numbers based on a release branch
# @author Kosta Harlan
# Usage: `python resources/bump_versions.py`
from os import remove, close
import os
import fileinput
from sys import exit
from tempfile import mkstemp
@kostajh
kostajh / drushrc.php
Created February 23, 2012 18:33
Abandon install profile
// Site specific options
$options['destination'] = 'sites/all/modules/contrib';
@kostajh
kostajh / db_update.sh
Created February 28, 2012 21:06
Rebuild script for Drupal Install Profile
# This script facilitates obtaining the latest DB data from the production
# Drupal 5 site.
# The script gets an ordered dump of the D5 database, and commits it to the
# git@git.designhammer.net:mysite_d5.git repository master branch.
# We make use of the rebuild.config file, so please make sure that your
# settings are correct there!
# We also assume that your drush aliases are setup correctly for
# @mysite.dev and @mysite_d5.prod. Please check mysite.aliases.drushrc.example,
# make sure your @mysite.dev alias is set up correctly, rename the file
# to mysite.aliases.drushrc.php and move it into your ~/.drush directory.
@kostajh
kostajh / example.tasks.php
Created March 27, 2012 19:16
example.tasks.php
<?php
#!/usr/bin/env drush
// Example rebuild script
// local alias
$self_record = drush_sitealias_get_record('@self');
$self_name = '@' . $self_record['#name'];
@kostajh
kostajh / ac-issue.sublime-snippet
Created August 15, 2012 17:25
activeCollab issue template
<snippet>
<content><![CDATA[
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h4 id="summary-dh-tasks">DH Tasks</h4>
@kostajh
kostajh / fix-permissions.sh
Created August 20, 2012 13:03
Securing file permissions and ownership for Drupal
#!/bin/bash
# This script is from [Securing file permissions and ownership](https://drupal.org/node/244924)
DRUPAL_PATH=${1%/}
DRUPAL_USER=${2}
APACHE_GROUP="www-data"
HELP="\nHELP: This script is used to fix permissions of a drupal installation\nyou need to provide the following arguments:\n\t 1) path to your drupal installation\n\t 2) Username of the user that you want to give files/directories ownership\nNote: \"www-data\" (apache default) is assumed as the group the server is belonging to, if this is different you need to modify it manually by editing this script\n\nUsage: (sudo) bash ${0##*/} drupal_path user_name\n"
if [ -z "${DRUPAL_PATH}" ] || [ ! -d "${DRUPAL_PATH}/sites" ] || [ ! -f "${DRUPAL_PATH}/modules/system/system.module" ]; then
<?php
if ( isset( $wp_query -> query_vars['is_past'] ) ) {
$url = bloginfo('url');
echo <a href=sprintf("%s/events/", $url)><h4>View Upcoming Events</h4></a>;
else {
echo <a href=sprintf("%s/events/past/", $url)><h4>View Past Events</h4></a>;
}
?>
<?php
$url = get_bloginfo('url');
if ( isset( $wp_query -> query_vars['is_past'] ) )
{
$path = sprintf('<a href=%s/events/><h4>View Upcoming Events</h4></a>', $url);
echo $path;
}
else
{
echo '<a href=sprintf("%s/events/past/", $url)><h4>View Past Events</h4></a>';
@kostajh
kostajh / 0_reuse_code.js
Created December 12, 2013 19:42
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
var uri = casper.cli.get('uri');
var link = 'http://' + uri;
var alias = casper.cli.get('alias');
var drush = 'http://localhost:8888/' + alias + ' ';
var repo_dir = casper.cli.get('repo');
casper.test.begin('Setup methods for test suite', function suite(test) {
// Begin setUp().
casper.start(drush + 'core-status --format=json', function() {