Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Git apply for a remote patch file
if ! [ "$1" = "" ]; then
filename=`echo $1 | sed -e 's/^.*\///'`
wget --output-document=/tmp/$filename $1
git apply /tmp/$filename
rm /tmp/$filename
else
@juhasz
juhasz / st
Created October 19, 2011 11:00
#!/bin/bash
# Open Git repository with Sourcetree.app
if [ "$1" = "" ]; then
dir=`pwd`
else
dir=$1
fi
--regex-PHP=/^[[:blank:]]*((abstract|final|private|protected|public|static)[[:blank:]]+)?function[[:blank:]]+(&?[[:alnum:]_]*).*$/\3/f/
$key = '123123';
$data_str = '8PAYUDEMO42578192011-06-15 17:05:5513CD lejátszó12Fejhallgató5CDPLY6CSTAUD10Adapterrel04250033501111101034503HUF2108Budapest4Pest2HU8CCVISAMC';
$b = 64; // byte length for md5
if (strlen($key) > $b) {
$key = pack("H*",md5($key));
}
$key = str_pad($key, $b, chr(0x00));
$ipad = str_pad('', $b, chr(0x36));
$opad = str_pad('', $b, chr(0x5c));
$k_ipad = $key ^ $ipad;
nnoremap <space> :| inoremap jk <esc>|se softtabstop=2|se tabstop=2|se expandtab|se shiftwidth=2|se autoindent|se smartindent
[18:07:46] weal: very curious about that one
[18:08:02] GaborHojtsy: that is you know OOP, PSR-0, Iterator-using, and all that stuff
[18:08:23] webchick: lol
[18:08:29] GaborHojtsy: at http://drupal.org/node/1189184 sutha is on it, but more help is welcome!
[18:08:31] Druplicon: http://drupal.org/node/1189184 => Make gettext .po generation its own abstracted functionality => Drupal core, locale.module, normal, needs review, 23 comments, 5 IRC mentions
[18:08:40] plach: in one word it's being cool-stuffed
[18:09:01] GaborHojtsy: we discovered Drupal 7 has some helper functions that are PHP 3 era code, eg. reimplementations of wordwrap() in userspace
[18:09:02] GaborHojtsy: fun things
[18:09:58] GaborHojtsy: and finally, usability stuff for moving negotiation to the language module: http://drupal.org/node/1468930
[18:10:04] Druplicon: http://drupal.org/node/1468930 => Move negotiation functionality from locale module to language module => Drupal core, locale.module, normal, needs work, 9 comments, 1 IRC mention
(function ($){
Drupal.behaviors.eci_generated = {
attach: function (context, settings) {
console.log('2');
$('#logo').hide();
}
}
})(jQuery)
@juhasz
juhasz / gist:2358317
Created April 11, 2012 09:54
VIM: split and align SQL queries - a quick way
s/, /,\r / | '{,.s/ FROM/\rFROM/ | '{,'}s/ JOIN/\r JOIN/ | s/ WHERE/\rWHERE/ | s/ AND/\r AND/ | '{,'}s/ ORDER/\rORDER/ | '{,'}s/ LIMIT/\rLIMIT/
# envvars - default environment variables for apache2ctl
# this won't be correct after changing uid
unset HOME
# for supporting multiple apache2 instances
if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then
SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}"
else
SUFFIX=
@juhasz
juhasz / drupal-couchdb-settings.patch
Created October 2, 2012 08:35
Patch to include couchdb settings in a Drupal 7 default.settings.php file
diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
index 0b12bd3..7f726d4 100644
--- a/sites/default/default.settings.php
+++ b/sites/default/default.settings.php
@@ -546,3 +546,9 @@ $conf['404_fast_html'] = '<html xmlns="http://www.w3.org/1999/xhtml"><head><titl
* Remove the leading hash signs to disable.
*/
# $conf['allow_authorize_operations'] = FALSE;
+
+# CouchDB connection settings.