This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Run with: | |
# python hello.py cameron | |
# python hello.py | |
# import modules used here -- sys is a very standard one | |
import sys | |
import subprocess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
e53a722096f0 aafd21071b99 /opt/bin/run_all 41 minutes ago Up 28 minutes 127.0.0.1:49251->22/tcp, 127.0.0.1:49252->9200/tcp es-b | |
0208431f9c7b aafd21071b99 /opt/bin/run_all 41 minutes ago Up 28 minutes 127.0.0.1:49249->22/tcp, 127.0.0.1:49250->9200/tcp es-a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
dsm(taxonomy_term_load(1060)); | |
dsm(taxonomy_term_load(1064)); | |
$term = taxonomy_term_load(1311); | |
$filepath = drupal_realpath('sites/powertech_crabtree/files/images/footer_logo_aberdare.png'); | |
// Create managed File object and associate with Image field. | |
$file = (object) array( | |
'uid' => 1, | |
'uri' => $filepath, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Uses the passed in term and its children and gets the associated nodes. Pass | |
* the returned array into entity_load to load the nodes. | |
* | |
* @author Batandwa Colani | |
* @date 2014-02-20 | |
* @version 1 | |
* | |
* @param int $tid The parent term id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="fadein"> | |
<img src="http://farm3.static.flickr.com/2610/4148988872_990b6da667.jpg"> | |
<img src="http://farm3.static.flickr.com/2597/4121218611_040cd7b3f2.jpg"> | |
<img src="http://farm3.static.flickr.com/2531/4121218751_ac8bf49d5d.jpg"> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function HOOK_menu_alter(&$items) { | |
$search = 'node/'; | |
foreach ($items as $path => $options) { | |
if(strpos($path, $search) === 0) { | |
drupal_set_message('<strong>' . $path . '</strong><pre>'.var_export($options, TRUE).'</pre>', 'status', FALSE); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$2" ];then | |
echo "We need two parameters, boet." | |
echo " Usage: $FUNCNAME vagrant-name vbox-machine-name" | |
return 1 | |
fi | |
export lowername=$2 | |
export tempdir=createvmbox.$((RANDOM)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
module_load_include('module', 'image'); | |
$styles = array_keys(image_styles()); | |
image_style_flush($styles); | |
drupal_set_message(t('Flushed images for the following styles: %styles.', array('%styles' => implode(', ', $styles))), 'status', FALSE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div.panel-pane div.admin-links { | |
font-size: 100%; | |
position:relative; | |
width:100%; | |
} | |
div.panel-pane div.admin-links li { | |
padding-bottom: 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin, os, subprocess | |
class ConemuCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
if os.name == "nt": | |
startupinfo = subprocess.STARTUPINFO() | |
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW | |
process = subprocess.Popen(('c:/Program Files (x86)/ConEmu/ConEmu.exe', '/single', self.view.file_name()), |