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
CmdUtils.CreateCommand({ | |
name: "search-php", | |
homepage: "http://createopen.com/blog/", | |
author: { name: "David Hulbert", email: "[email protected]"}, | |
icon: "http://static.php.net/www.php.net/favicon.ico", | |
license: "MPL", | |
takes: {"function": noun_arb_text}, | |
description: "Searches PHP for a function.", |
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
/* | |
TODO: | |
match beginnings of function names | |
say if no functions found | |
if > 1 function result, have a list of them | |
option to show more details of function? | |
get it working with gotapi.com and all languages it supports | |
*/ | |
CmdUtils.CreateCommand({ | |
name: "search-php", |
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
/** | |
* Make a form field shorten text as you type | |
* Made for keeping tweets < 140 chrs | |
* Usage: $('textarea').twtShrt(); | |
* @author dave1010 | |
*/ | |
jQuery.fn.twtShrt = function() { | |
var o = [ | |
"seriously","have to", "what is", "done", "oh my god", "oh my gosh", "face to face", "for the win", "for the loss", "in real life", "your mileage may vary", "best regards", "joint venture", "let me know", "not safe for work", "are you ok", "tomorrow", "as soon as possible", "be right back", "be back later", "be back soon", "at the moment", "by the way", "in my honest opinion", "tata for now", "as known as", "also known as", "see you later", "see you", "for your information", "in my opinion", "too good to be true", "best friends forever", "best friend forever", "best friends", "best friend", "definitely", "been", "hello", "i am", "night", "when", "some", "to", "speak", "you", "your", "for", "friend", "people", "see", "be", "and", "&", "anyone", "because", "are", "bate", "date", "fate", "great", "hate", "late", "mate", |
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 | |
function strip_word_html($text, $allowed_tags = '<b><i><sup><sub><em><strong><u><br>') | |
{ | |
mb_regex_encoding('UTF-8'); | |
//replace MS special characters first | |
$search = array('/‘/u', '/’/u', '/“/u', '/”/u', '/—/u'); | |
$replace = array('\'', '\'', '"', '"', '-'); | |
$text = preg_replace($search, $replace, $text); | |
//make sure _all_ html entities are converted to the plain ascii equivalents - it appears | |
//in some MS headers, some html entities are encoded and some aren't |
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
// add as a bookmark with "javascript:" at the beginning of the URL to make into a bookmarklet | |
(function(){var o = '';$('.issue').each(function() {var n = '#' + $('.number', this).text().replace('.', '') + ' - ',t = $('.issue_title', this).text();o += n+t + '\n';});alert(o);})(); |
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
#!/bin/bash | |
# use ubuntu's notification system to let us know when there's something new in the apache error log | |
tail -n0 -f /var/log/apache2/error.log | while read line | |
do | |
body=`echo $line | cut -f 9- -d ' '` | |
notify-send -c im.received -i error "Apache / PHP error" "$body" | |
done |
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
// this is because of http://stackoverflow.com/questions/4398966/how-can-i-hide-select-options-with-javascript-cross-browser/4423543 | |
(function($){ | |
$.fn.extend({detachOptions: function(o) { | |
var s = this; | |
return s.each(function(){ | |
var d = s.data('selectOptions') || []; | |
s.find(o).each(function() { | |
d.push($(this).detach()); |
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
grep time tests.xml | grep testcase | awk "{ print \$7 \$2 }"|sed 's/name="/ /g'|sed 's/time="//g'|sed 's/"\/>//g'|sed 's/"//g'|sort |
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
#!/bin/bash | |
echo '(' |
OlderNewer