This file contains hidden or 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
# My preferred prompt for Powershell. | |
# Displays git branch and stats when inside a git repository. | |
# See http://gist.github.com/180853 for gitutils.ps1. | |
. (Resolve-Path ~/Documents/WindowsPowershell/gitutils.ps1) | |
function prompt { | |
$path = "" | |
$pathbits = ([string]$pwd).split("\", [System.StringSplitOptions]::RemoveEmptyEntries) | |
if($pathbits.length -eq 1) { |
This file contains hidden or 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 Syntax Check for Git pre-commit hook for Windows PowerShell | |
# | |
# Author: Vojtech Kusy <[email protected]> | |
# | |
############################################################################### | |
### INSTRUCTIONS ### |
This file contains hidden or 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
############################################################################### | |
# | |
# Cleanup of Drupal modules using Drush & Windows PowerShell | |
# | |
# Author: Vojtech Kusy <[email protected]> | |
# | |
############################################################################### | |
# Create directory .trash if doesn't exist | |
if(!(Test-Path .\.trash -pathtype container)) { |
This file contains hidden or 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
/** | |
* MYISAM --> INNODB query generator. | |
* | |
* Converts all tables in the given database from MYISAM to INNODB. | |
* | |
* http://codesnippets.joyent.com/posts/show/1451 | |
* http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-23295 | |
*/ | |
SELECT CONCAT('ALTER TABLE ',table_schema,'.',table_name,' engine=MyISAM;') FROM information_schema.tables WHERE TABLE_SCHEMA='my_database' AND ENGINE = 'InnoDB'; |
This file contains hidden or 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 | |
/** | |
* Implementation of hook_nodeapi(). | |
* | |
* Revoke Views cache on each insert, update, delete of the node. | |
*/ | |
function mymodule_special_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { | |
// Clear all cached views results and rendered outputs on node updates | |
// for particular views: |
This file contains hidden or 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 | |
/** | |
* NOT SAFE! Disable the Feature before running this! | |
*/ | |
$name = 'obsolete_feature'; | |
db_query("DELETE FROM {system} WHERE `name`='%s'", $name); | |
db_query("DELETE FROM {cache} WHERE `cid`='features_module_info'"); | |
db_query("DELETE FROM {variable} WHERE `name`='features_codecache'"); |
This file contains hidden or 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 | |
/** | |
* Wipe out whole taxonomy vocabulary. | |
*/ | |
$vocabulary_vid = 4; | |
$result = db_query("SELECT * FROM `term_data` WHERE `vid`=%d;", $vocabulary_vid); | |
while ($term = db_fetch_array($result)) { | |
$term['type'] = 'term'; | |
taxonomy_del_term($term); | |
} |
This file contains hidden or 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
# http://stackoverflow.com/questions/3058560/how-do-i-change-a-files-path-in-gits-history/3063008#3063008 | |
git filter-branch --index-filter ' | |
git ls-files -s | | |
sed "s-\t\"*-&subdirectory/-" | | |
GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info && | |
mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE | |
' HEAD |
This file contains hidden or 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
# git rebase -i allows you to conveniently edit any previous commits, except for the root # commit. The following commands show you how to do this manually. | |
# http://stackoverflow.com/questions/2246208/change-first-commit-of-project-with-git/2322798#2322798 | |
# tag the old root, "git rev-list ..." will return the hash of first commit | |
git tag root `git rev-list HEAD | tail -1` | |
# switch to a new branch pointing at the first commit | |
git checkout -b new-root root | |
# make any edits and then commit them with: | |
git commit --amend |
This file contains hidden or 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
během,bez,díky,do,k,kolem,krom,kromě,kvůli,mezi,mezi,mimo,místo,na,nad,nade,naproti,o,od,okolo,oproti,po,pod,pode,podél,podle,pomocí,pro,prostřednictvím,proti,před,před,při,s,skrz,skrze,stran,u,v,vedle,z,za,zpět |