##Drupal
cache busting in Drupal
drupal_flush_all_caches()
drupal_clear_css_cache()
drupal_clear_js_cache()
getting the full URI of an image
.DS_* | |
._.DS_* | |
*.sass-cache* | |
styles/ |
module.exports = function(grunt) { | |
"use strict"; | |
var theme_name = 'f5'; | |
var global_vars = { | |
theme_name: theme_name, | |
theme_css: 'css', | |
theme_scss: 'scss' | |
} |
//credit http://stackoverflow.com/questions/323517/is-there-an-equivalent-for-var-dump-php-in-javascript | |
function dump(obj) { | |
var out = ''; | |
for (var i in obj) { | |
out += i + ": " + obj[i] + "\n"; | |
} | |
alert(out); | |
// or, if you wanted to avoid alerts... |
/* | |
* At the end of the settings.php file for drupal add these lines | |
*/ | |
/** | |
* settings file routing | |
*/ | |
if (file_exists(dirname(__FILE__) . '/local.settings.php')) { | |
include dirname(__FILE__) . '/local.settings.php'; | |
} |
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
#Environment Variables | |
export PATH="/usr/local/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin:/opt:$HOME/bin:$HOME/drush:/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php5.3/bin:$PATH" | |
export EDITOR=vim | |
# Set name of the theme to load. | |
ZSH_THEME="robbyrussell" | |
COMPLETION_WAITING_DOTS="true" |
{ | |
"autosave": false, | |
"color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme", | |
"default_line_ending": "unix", | |
"ensure_newline_at_eof_on_save": true, | |
"fallback_encoding": "UTF-8", | |
"file_exclude_patterns": | |
[ | |
".DS_Store" | |
], |
<?php | |
function log_to_file($text) { | |
$f = fopen('/tmp/my_log.txt', 'a'); | |
fwrite($f, date('Ymd H:i:s - ') . $text . "\n"); | |
fclose($f); | |
} | |
// to print arrays/objects use | |
// log_to_file(print_r($obj, $return = TRUE)); |
##Drupal
cache busting in Drupal
drupal_flush_all_caches()
drupal_clear_css_cache()
drupal_clear_js_cache()
getting the full URI of an image
{ | |
"folders": | |
[ | |
{ | |
"path": "/home/<USER>/workspace/<PROJECT>", | |
"name": "root", | |
"file_exclude_patterns": [ | |
".sasscache", "*.css" | |
] | |
}, |
<?php | |
/** | |
* To discover information about the nodes in a given type | |
* @param $type a string, choose a content type machine name | |
* @return a string | |
*/ | |
function get_nodes_statuses($type) { | |
$result = db_query('SELECT n.nid, n.title, n.changed FROM {node} n WHERE n.type = :type', array(':type' => $type)); | |
$i = 0; | |
if ($result) { |