Skip to content

Instantly share code, notes, and snippets.

@DBasic
DBasic / fhs.md
Last active August 29, 2015 14:17
[linux] FHS - Filesystem Hierarchy Standard (Стандарт иерархии файловой системы)

FHS - Filesystem Hierarchy Standard (Стандарт иерархии файловой системы)

###English

Directory Description
/ Primary hierarchy root and root directory of the entire file system hierarchy.
/bin Essential command binaries that need to be available in single user mode; for all users, e.g., cat, ls, cp.
/boot Boot loader files, e.g., kernels, initrd.
@DBasic
DBasic / wp_query_args.php
Last active August 29, 2015 14:17 — forked from billerickson/gist:3698476
[Wordpress] WP Query Args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@DBasic
DBasic / list_users.sh
Last active August 29, 2015 14:16
[linux] list all users
cut -d: -f1 /etc/passwd
list groups
cut -d: -f1 /etc/group
http://www.cyberciti.biz/faq/linux-remove-user-command/
To find all files owned by user vivek, enter:
# find / -user vivek -print
@DBasic
DBasic / 0_reuse_code.js
Last active August 29, 2015 14:11
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
@DBasic
DBasic / remove-empty-p.php
Last active August 29, 2015 14:10 — forked from vadeemch81/remove-empty-p.php
[Wordpress] Remove empty "p" tags
<?php
add_filter( 'the_content', 'remove_empty_p', 20, 1 );
function remove_empty_p( $content ){
// clean up p tags around block elements
$content = preg_replace( array(
'#<p>\s*<(div|aside|section|article|header|footer)#',
'#</(div|aside|section|article|header|footer)>\s*</p>#',
'#</(div|aside|section|article|header|footer)>\s*<br ?/?>#',
'#<(div|aside|section|article|header|footer)(.*?)>\s*</p>#',
'#<p>\s*</(div|aside|section|article|header|footer)#',
@DBasic
DBasic / sass_mixins.scss
Last active November 30, 2022 15:23
[SASS] Mixins
# Retina Images
This mixin by Jason Zimdars is a breeze to use and offers a greater visual experience to those that are lucky enough to have a retina device.
@mixin image-2x($image, $width, $height) {
@media (min--moz-device-pixel-ratio: 1.3),
(-o-min-device-pixel-ratio: 2.6/2),
(-webkit-min-device-pixel-ratio: 1.3),
(min-device-pixel-ratio: 1.3),
(min-resolution: 1.3dppx) {
@DBasic
DBasic / joomla-test.txt
Last active August 29, 2015 14:08
[oDesk] Joomla Test
Which of the following is a system event?
D: onAfterInitialise
What types of extensions does Joomla include?
C: Component, Module, Template, Language, Plugin
Why does Joomla use templateDetails.xml files?
C: To provide information and allow selection of the template within the template manager;
Which of the folowing statements prevents SQL Injection Attacks
@DBasic
DBasic / Wordpress # Disable Comments Programmatically.php
Last active August 29, 2015 14:08
[Wordpress] Disable Comments Programmatically
function example_disable_all_comments_and_pings() {
// Turn off comments
if( '' != get_option( 'default_ping_status' ) ) {
update_option( 'default_ping_status', '' );
} // end if
// Turn off pings
if( '' != get_option( 'default_comment_status' ) ) {
update_option( 'default_comment_status', '' );
@DBasic
DBasic / sublime_text_3
Last active November 14, 2020 10:45
[ST3] Guides, configs, keys
Sublime Text 3
/*=================================================================
= Сделать текстовым редактором по умолчанию =
=================================================================*/
/* LINUX */
First, make sure that /usr/share/applications/sublime_text.desktop exists:
@DBasic
DBasic / linux_usefull_commands
Last active August 29, 2015 14:07
Полезные Linux команды
Полезные Linux комманды
Посмотреть все группы на сервере
groups
Посмотреть группы для указанного пользователя
groups user_name
Главная группа
getent group user_name