Skip to content

Instantly share code, notes, and snippets.

@folmert
folmert / apache_rewrite_server_part.htaccess
Created July 29, 2015 07:22
apache_rewrite_server_part
RewriteCond %{HTTP_HOST} ^interclick2.home\.pl$ [NC]
RewriteRule ^(.*)$ http://artwalls.pl/$1 [R=301,L]
@folmert
folmert / joomla_last_sql_query.php
Created July 13, 2015 10:05
joomla_last_sql_query
var_dump((string)$db->getQuery());
@folmert
folmert / g-recaptcha rwd.scss
Last active August 29, 2015 14:23
g-recaptcha rwd
.b2j_contact form .b2j-contact-actions {
.g-recaptcha {
overflow:hidden;
width:180px;
height:65px;
border:1px solid #e6e6e6;
@folmert
folmert / joomla_redirect.php
Created June 23, 2015 10:37
joomla_redirect
JFactory::getApplication()->redirect(JURI::base().'strefa-uzytkownika', $error, 'error' );
@folmert
folmert / joomla_sql_select.php
Created June 9, 2015 09:03
joomla_sql_select
$db =& JFactory::getDBO();
$query = $db->getQuery(true);
$query->select('value');
$query->from('sls37_djc2_items_extra_fields_values_text');
$query->where('item_id ='.$itemId);
$query->AND('field_id ='.$field->id);
$db->setQuery($query);
$fieldValue = $db->loadObjectList();
<?php
// Create a new cURL resource
$curl = curl_init();
if (!$curl) {
die("Couldn't initialize a cURL handle");
}
@folmert
folmert / javascript_resources.md
Last active August 29, 2015 14:22 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@folmert
folmert / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php if($this->countModules('module name')) :?>
<!-- code -->
<?php else: ?>
<!-- code -->
<?php endif;?>
if( e.target === this ) {
return "clicked element is parent";
}
else {
return "clicked element is child"
}
// "this" always refers to the DOM element the listener was attached to,
// event.target is the actual DOM element that was clicked.