This file contains hidden or 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 | |
function check_email_address($email) { | |
// First, we check that there's one @ symbol, and that the lengths are right | |
if (!preg_match("/^[^@]{1,64}@[^@]{1,255}$/", $email)) { | |
// Email invalid because wrong number of characters in one section, or wrong number of @ symbols. | |
return false; | |
} | |
// Split it into sections to make life easier | |
$email_array = explode("@", $email); | |
$local_array = explode(".", $email_array[0]); |
This file contains hidden or 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 | |
/* | |
db connection shit loaded here | |
*/ | |
set_time_limit(0); | |
ini_set('memory_limit', '120M'); | |
include "XmlStreamer.php"; | |
class SimpleXmlStreamer extends XmlStreamer { |
This file contains hidden or 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
Cine mai vine? | |
Daniel Daianu Prim-vice ASF | |
Daniel Chiţoiu. Viceprim-ministru, Ministrul Finanțelor Publice | |
Varujan Vosganian, Ministrul Economiei | |
Liviu Voinea, Ministrul delegat pentru Buget | |
Platforma nr. 1 din Romania | |
Lanseza in spatiul public la data 1 IULIE, ORA 10 SNSPA sala NATO , nevoia unui program si a unei agentii guvernamentale dedicate START-UP-URILOR ŞI SPINOFF-URILOR INOVATIVE.” | |
Un proiect pentru 50,000 de tineri antreprenori şi pentru viitorul unei generaţii |
This file contains hidden or 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
sudo su - | |
# stuff we need to build from source | |
apt-get install libpcre3-dev build-essential libssl-dev | |
# get the nginx source | |
cd /opt/ | |
wget http://nginx.org/download/nginx-0.8.54.tar.gz | |
tar -zxvf nginx* | |
# we'll put the source for nginx modules in here |
This file contains hidden or 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
$('body').on('click', 'a, img, button', function(e) { | |
var $el = $(e.target); | |
if($el.data('event-count')) { | |
$el.data('event-count', ($el.data('event-count') + 1)); | |
} else { | |
$el.data('event-count', 1); | |
} | |
var category = e.target.nodeName; |
This file contains hidden or 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
rewrite ^/product/(.*).html$$ /products.php?q=$1&rewrite=1 last; | |
rewrite ^/review/(.*).html$ /reviews.php?q=$1&rewrite=1 last; | |
#category | |
location = /category/ { | |
rewrite ^(.*)$ /categories.php; | |
} | |
This file contains hidden or 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
<!-- Async Tracking Code - http://code.google.com/intl/en-US/apis/analytics/docs/tracking/asyncTracking.html --> | |
<script type="text/javascript"> | |
var _gaq = _gaq || []; | |
_gaq.push(['_setAccount', 'YOUR ANALYTICS ID GOES HERE']); | |
_gaq.push(['_trackPageview']); | |
//******************* | |
// Trick #1: Track page load time in Google Analytics | |
// (note: only works for HTML5 browsers) | |
//******************* |
This file contains hidden or 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
// todo save to db | |
pjs.addSuite({ | |
title: 'emag fucker', | |
url: 'http://www.emag.ro', | |
moreUrls: 'a', | |
maxDepth: 0, | |
// function to get some data | |
scraper: function() { | |
return { |
This file contains hidden or 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
//PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov [email protected] 2012 | |
(function(host) { | |
function Crawler() { | |
this.visitedURLs = {}; | |
}; | |
Crawler.webpage = require('webpage'); |
This file contains hidden or 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 | |
$var = NULL "" 0 "0" 1 | |
strlen($var) = 0 0 1 1 1 | |
is_null($var) = TRUE FALSE FALSE FALSE FALSE | |
$var == "" = TRUE TRUE TRUE FALSE FALSE | |
!$var = TRUE TRUE TRUE TRUE FALSE | |
!is_null($var)= FALSE TRUE TRUE TRUE TRUE | |
$var != "" = FALSE FALSE FALSE TRUE TRUE | |
$var = FALSE FALSE FALSE FALSE TRUE |