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
twttr.widgets.load(); |
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
jQuery('#last_tweet').urlize(); | |
jQuery.fn.urlize = function() { | |
if (this.length > 0) { | |
this.each(function(i, obj){ | |
// making links active | |
var x = jQuery(obj).html(); | |
var list = x.match( /\b(http:\/\/|www\.|http:\/\/www\.|https:\/\/www\.|https:\/\/)[^ <]{2,200}\b/g ); | |
if (list) { | |
for ( i = 0; i < list.length; i++ ) { |
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
<!-- Place this tag in your head or just before your close body tag --> | |
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"> | |
{parsetags: 'explicit'} | |
</script> | |
<!-- Place this tag where you want the +1 button to render --> | |
<g:plusone></g:plusone> | |
<!-- Place this render call where appropriate --> | |
<script type="text/javascript">gapi.plusone.go();</script> |
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
# Apache configuration file | |
# httpd.apache.org/docs/2.2/mod/quickreference.html | |
# Note .htaccess files are an overhead, this logic should be in your Apache config if possible | |
# httpd.apache.org/docs/2.2/howto/htaccess.html | |
# Techniques in here adapted from all over, including: | |
# Kroc Camen: camendesign.com/.htaccess | |
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/ | |
# Sample .htaccess file of CMS MODx: modxcms.com |
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 that checks whether the data are the on-screen text. | |
// It works in the following way: | |
// an array arrfailAt stores the control words for the current state of the stack, which show that | |
// input data are something else than plain text. | |
// For example, there may be a description of font or color palette etc. | |
function rtf_isPlainText($s) { | |
$arrfailAt = array("*", "fonttbl", "colortbl", "datastore", "themedata"); | |
for ($i = 0; $i < count($arrfailAt); $i++) |
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
/** | |
* age calculations based on date | |
* | |
* @param date $birth_date date in format Y-m-d | |
* | |
* @return bool|int | |
*/ | |
function age($birth_date) | |
{ | |
if (! preg_match('/\d{4}-\d{2}-\d{2}/', $birth_date)) { |
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
/** | |
* pobieramy liste produktow | |
* | |
* @param integer $start od rekordu | |
* @param integer $limit ilość wyników | |
* @param integer $category_id id kategorii | |
* | |
* @return void | |
*/ | |
public function products($start = 0, $limit = NULL, $category_id = NULL) |
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
mount_msdosfs -o large -L pl_PL.UTF-8 /dev/da0s1 /mnt/usb2/ |
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
$('.typeahead').typeahead({ | |
source: function (query, process) { | |
return $.get('/typeahead', { query: query }, function (data) { | |
return process(data); | |
}); | |
} | |
}); |
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 | |
/** | |
* @param $arr | |
* @param string $key | |
* | |
* @return void | |
*/ | |
function make_assoc(&$arr, $key = 'id') | |
{ | |
$tmp = $arr; |
OlderNewer