Skip to content

Instantly share code, notes, and snippets.

<!-- Ten fragment wyświetli ostatnie tematy: -->
<!-- IF S_ENABLE_SE_RECENT_TOPICS -->
<div class="widget widget-narrow">
<h4 class="widget-title">Najnowsze tematy</h4>
<ul class="widget-links">
<!-- BEGIN se_recent_topics -->
<li class="widget-links-item"><a href="{se_recent_topics.SE_RECENT_TOPIC_URL}" title="{L_VIEW_TOPIC}: {se_recent_topics.SE_RECENT_TOPIC_TITLE}">{se_recent_topics.SE_RECENT_TOPIC_TITLE}</a></li>
<!-- END se_recent_topics -->
</ul>
@jpustula
jpustula / gist:6764927
Created September 30, 2013 14:50
Useful Linux snippets.
# Converts recursively line endings of all files in a directory.
# Requires at least dos2unix 6.0 to automatically exclude binary files.
find . -type f -print0 | xargs -0 dos2unix
@jpustula
jpustula / gist:5752823
Created June 10, 2013 22:06
Disable floppy module in Ubuntu (useful in VMware).
echo "blacklist floppy" | sudo tee /etc/modprobe.d/blacklist-floppy.conf
sudo rmmod floppy
sudo update-initramfs -u
[Część 1]
2. True
4.
DESCRIBE hr.departments;
SELECT * FROM hr.departments;
5.
DESCRIBE hr.EMPLOYEES;
SELECT EMPLOYEE_ID, last_name, job_id, hire_date
/**
* Implementacja funkcji pi(n).
* Oblicza liczbę liczb pierwszych z zadanego przedziału
*
* @param int n Liczba naturalna
*/
public static int pi(int n) {
/**
* Liczba liczb pierwszych z zadanego przedziału.
* Wartość początkowa pochodzi z zadanego wzoru.
@jpustula
jpustula / tablefield.module.patch
Created August 16, 2012 09:42
Changes in Tablefield 2.0 module (Drupal 7.15) for ap-serwis.pl. Remove table header styles and add colon to text in first column.
*** tablefield.module 2012-01-13 13:28:18.000000000 -0800
--- tablefield.module 2012-08-16 02:34:37.029457200 -0700
***************
*** 186,194 ****
--- 186,198 ----
foreach ($tabledata as $row_key => $row) {
foreach ($row as $col_key => $cell) {
if (!empty($table['format'])) {
+ // Add colon after name in first table column
+ $cell = ($col_key == 0) ? $cell . ':' : $cell;
@jpustula
jpustula / page_title.module.patch
Created August 1, 2012 19:10
Changes in Page Tile 2.7 module for Drupal 7. Repairs pager suffix pattern.
--- old/page_title.module 2012-05-09 11:28:00.000000000 +0200
+++ new/page_title.module 2012-08-01 20:43:49.032958200 +0200
@@ -601,19 +601,23 @@
if (is_null($title)) {
$types = array('global' => NULL);
-
+ $status = drupal_get_http_header("status");
+
// Allow hook_page_title_pattern_alter() to modify the pattern and tokens
@jpustula
jpustula / gist:1136739
Created August 10, 2011 12:57
Count unread post for phpBB 3.0.9 (file includes/functions.php)
// Count posts since last vivist
if ($user->data['is_registered'] && $config['load_search'] && $auth->acl_get('u_search') && $auth->acl_getf_global('f_search'))
{
/*$ex_fid_ary = array_unique(array_merge(array_keys($auth->acl_getf('!f_read', true)), array_keys($auth->acl_getf('!f_search', true))));
if ($auth->acl_get('m_approve'))
{
$m_approve_fid_ary = array(-1);
$m_approve_fid_sql = '';
}
<!-- BEGIN forumrow -->
<!-- IF (forumrow.S_IS_CAT and not forumrow.S_FIRST_ROW) or forumrow.S_NO_CAT -->
</ul>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->
<!-- IF forumrow.S_IS_CAT or forumrow.S_FIRST_ROW or forumrow.S_NO_CAT -->
@jpustula
jpustula / converter.php
Created August 27, 2010 15:56
Convert phpBB3's database and tables to Unicode
<?php
/**
* Convert phpBB3's database and tables to Unicode
*
* @author Jarosław Pustuła <[email protected]>
* @license http://www.gnu.org/licenses/gpl.html
*/
/*$dbms = '';