Skip to content

Instantly share code, notes, and snippets.

<?php
$categoriesNames = array();
foreach ($categories as $categoryName) {
$categoriesNames[] = trim((string)$categoryName);
}
// так же лучше?
$categoriesNames = array_map("trim", $categories);
@dimkalinux
dimkalinux / adblock.txt
Created January 13, 2013 20:36
My adblock rules.
###bottomads
##.fb-like
##.fb-like-box
##.fbFooterBorder
##.twitter-follow-button
##.twitter-share-button
##[title="Share on Facebook"]
##[title="Share on Twitter"]
##A[href^="http://www.facebook.com/sharer.php?"]
-tizer.
@dimkalinux
dimkalinux / adblock.txt
Last active December 11, 2015 01:49
My adblock rules.
###bottomads
##.fb-like
##.fb-like-box
##.fbFooterBorder
##.twitter-follow-button
##.twitter-share-button
##[title="Share on Facebook"]
##[title="Share on Twitter"]
##A[href^="http://www.facebook.com/sharer.php?"]
-tizer.
perl -pe 's/.*<Id>(.*)<\/Id>/$1/g' < ceebo.id.txt > ceebo.id2.txt
@dimkalinux
dimkalinux / ParseISO8601.js
Created December 14, 2011 20:41
javascript to parse ISO-8601 date format
function ParseISO8601(iso)
{
// 0 = whole string
// 1 = year
// 2 = month
// 3 = day
// 4 = whole time part
// 5 = hour
// 6 = minute
// 7 = second
@dimkalinux
dimkalinux / menu.sh
Last active April 4, 2024 08:53
User menu file for Midnight Commander
shell_patterns=0
+ ! t t
@ Do something on the current file
CMD=%{Enter command}
$CMD %f
+ t t
@ Do something on the tagged files
set %t; CMD=%{Enter command}
while [ -n "$1" ]; do