Skip to content

Instantly share code, notes, and snippets.

@DBasic
DBasic / git_move.sh
Created March 7, 2014 07:30
Git # Move repository
#!/usr/bin/env bash
# Usage:
# ./git_move.sh git@repo_site.com:/my_repo.git origin/folder/path/ /destination/repo/path/ new/folder/path/
repo=$1
folder=$2
dest_repo=$3
dest_folder=$4
clone_folder='__git_clone_repo__'
@DBasic
DBasic / SP.php
Created March 8, 2014 17:45 — forked from stden/SP.php
/**
* @static Вызов хранимой процедуры
* @param $sp_name Название хранимой процедуры
* @param $params
* @return array
*/
public static function Query($sp_name, $params)
{
// Получаем CommandBuilder
$b = Yii::app()->db->getCommandBuilder();
@DBasic
DBasic / placeholder.scss
Last active August 29, 2015 14:03 — forked from antsa/placeholder.scss
[SASS] Placeholder mixin
// Placeholder @mixin for Sass
//
// A mixin to style placeholders in HTML5 form elements.
// Includes also a .placeholder class to be used with a polyfill e.g.
// https://github.com/mathiasbynens/jquery-placeholder
// Requires Sass 3.2.
//
// Example usage (.scss):
//
// input {
@DBasic
DBasic / github-oauth2-client.php
Last active December 8, 2016 09:56
[php] github oauth2 authorization
<?php
define('OAUTH2_CLIENT_ID', '');
define('OAUTH2_CLIENT_SECRET', '');
$authorizeURL = 'https://github.com/login/oauth/authorize';
$tokenURL = 'https://github.com/login/oauth/access_token';
$apiURLBase = 'https://api.github.com/';
session_start();
@DBasic
DBasic / git_filter_branch
Last active August 29, 2015 14:07 — forked from REDNBLACK/git_filter_branch.md
[git] filter git branch
str=$(cat <<'EOF'
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
EOF
)
@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 / 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 / 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 / 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(