Skip to content

Instantly share code, notes, and snippets.

View necenzurat's full-sized avatar
🥺
I still hate JS

Costin Moise necenzurat

🥺
I still hate JS
View GitHub Profile
<?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]);
<?php
/*
db connection shit loaded here
*/
set_time_limit(0);
ini_set('memory_limit', '120M');
include "XmlStreamer.php";
class SimpleXmlStreamer extends XmlStreamer {
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
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
$('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;
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;
}
<!-- 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)
//*******************
@necenzurat
necenzurat / emag.js
Last active April 19, 2016 12:56
emag web crawler in phantomjs + pjscrape.js
// 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 {
//PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov anton.al.ivanov@gmail.com 2012
(function(host) {
function Crawler() {
this.visitedURLs = {};
};
Crawler.webpage = require('webpage');
<?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