This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_latest_posts ($args) { | |
// change "no-cat" to your default "nocategory" catSlug | |
$blogCat = !empty($args['cat'])?$args['cat']:"no-cat"; | |
$postsCount = !empty($args['count'])?$args['count']:"2"; | |
$html; | |
$postArgs = array( | |
'posts_per_page' => $postsCount, | |
'category_name' =>$blogCat | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_post_coulmns($count){ | |
$html=array(); | |
$html[0]="<div id=column1>"; | |
$html[1]="<div id=column2>"; | |
$html[2]="<div id=column3>"; | |
$counter = 0; | |
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
query_posts(array( | |
'posts_per_page' => 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
url: "/theme/coursesearch/layout/menu_courses.php", | |
cache: true, | |
async: true, | |
success: function(html){ | |
// Внутри саксеса ты вставляеш код который должен получить данные пришедшие с сервера | |
$('.navbar .nav a').each(function(){ | |
$(this).parent().append('<div class="drop"></div>'); | |
$(this).html(html); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var string = "some text here with some amount of chars lets rteplaece it like a excerpt"; | |
var description = getExcerpt(string,10); | |
// принимает строку и лимит после скольки знаков искать пробел и обрезать | |
function getExcerpt( str, limit ){ | |
var fullText = str; | |
var shortText = str; | |
shortText = shortText.substr( 0, shortText.lastIndexOf( ' ', limit ) ) + '...'; | |
var returnString = { | |
fullText: fullText, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.profile.directive('ngGalleria', function() { | |
return { | |
restrict: 'E', | |
controller: function($scope, $timeout) {}, | |
template: '<div class="galleria"></div>', | |
scope: { | |
source: '=', | |
screen: '@' | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('task12').factory('transportService', ['$q', function ($q) { | |
var URL = 'ws://********.com:4000/login'; | |
var ws = null; | |
function getConnectedWebSocket() { | |
//Здесь разрешено писать ваш код | |
} | |
function sendMessage (message) { | |
var deferred = $q.defer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$wsdl = new \wsdl("https://test.achprocessing.com/api/ServiceTransaction.svc?wsdl"); | |
$apikey = "68ad3155-5900-4623-8be7-01b34caf86a2"; | |
$password = "SpyEscape2016!"; | |
$username = "APISpyEscape"; | |
$amount = 200; | |
$params = array ( 'achAuthentication' => array( | |
'ApiKey' => $apikey, | |
'Password' => $password, | |
'UserName' => $username, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Codeforges\PlaygroundBundle\Controller; | |
use MyProject\Proxies\__CG__\OtherProject\Proxies\__CG__\stdClass; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Symfony\Component\HttpFoundation\Response; | |
class SoapController extends Controller{ | |
function indexAction () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@App.factory 'MediaHelper', ['mytvConfig','$q','$upload', (mytvConfig,$q,$upload)-> | |
helper = | |
uploadVideo: (files)-> | |
deferred = $q.defer() | |
files.forEach (file)-> | |
if file.size/1000000 < 1300 | |
data = | |
api_password: mytvConfig.wistia.id | |
project_id: mytvConfig.me.remoteProjectId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@App.factory 'MediaHelper', ['mytvConfig','$q','$upload', (mytvConfig,$q,$upload)-> | |
helper = | |
settings: | |
maxFileSize: 1300 | |
uploadVideo: (files)-> | |
deferred = $q.defer() | |
files.forEach (file)=> | |
if file.size/1000000 < @settings.maxFileSize |
OlderNewer