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
@necenzurat
necenzurat / gist:4240437
Created December 8, 2012 14:24
nginx configuration file
server {
listen 80; ## listen for ipv4
server_name www.sent.ro sent.ro;
if ($host = 'www.sent.ro' ) {
rewrite ^/(.*)$ http://sent.ro/$1 permanent;
}
access_log /srv/www/sent.ro/logs/access.log;
se cauta 4 programatori:
zend, codeingniter sau de preferinta symphony
js, jquery, lugu lugu
engleză obligatoriu
proiecte maricele, cateva luni pana la 1 an
salariu: 1000 €
cine e interesat [email protected]
@necenzurat
necenzurat / ip.txt
Created February 27, 2013 12:56
Romanian IP List
5.2.128.0/17
5.12.0.0/14
5.35.208.0/21
5.41.0.0/16
5.42.160.0/19
5.83.32.0/20
5.107.0.0/16
5.154.0.0/15
5.156.0.0/16
5.157.128.0/17
$days = array(
"Monday" => array(
"start" => "măta",
"end" => "15"
),
"Tuesday" => array(
"start" => "1.25",
"end" => "15"
),
"Wednesday" => array(
<?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
//PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov [email protected] 2012
(function(host) {
function Crawler() {
this.visitedURLs = {};
};
Crawler.webpage = require('webpage');
@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 {
<!-- 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)
//*******************
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;
}
$('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;