Skip to content

Instantly share code, notes, and snippets.

View legendar's full-sized avatar
🎯
Focusing

Yaroslav Shulika legendar

🎯
Focusing
View GitHub Profile
@legendar
legendar / pi.c
Created April 18, 2012 19:14
calc Pi
#define _ F-->00 || F-OO--;
long F=00,OO=00;
main(){F_OO();printf("%1.3f\n", 4.*-F/OO/OO);}F_OO()
{
_-_-_-_
_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
@legendar
legendar / xdomainrequest.js
Created April 13, 2012 14:47
Cross-domain XHR IE+Jquery
// override default jQuery transport for IE
if(window['XDomainRequest']) {
// save default xhr
jQuery.ajaxSettings.xhr_back = jQuery.ajaxSettings.xhr;
jQuery.ajaxSettings.xhr = function() {
if(this.crossDomain) {
try {
// IE sucs
var xhr = new window.XDomainRequest();
xhr.onload = function() {
<match pattern="/login/">
<block name="nocache" />
<secure level="guest" only="true">
<template var="content" src="login.tpl.php"/>
<template src="index.tpl.php" />
<end/>
</secure>
<redirect/>
</match>
<?
function test($func) {
$func('Hello world!');
}
test(function($message){
echo $message;
});
<?php
/* получаем HTML по ссылке */
include('softenCurl.php');
$curlObject = new softenCurl();
$contents = $curlObject->get('http://google.com');
// в $contents будет HTML-код страницы
?>