Install Apache, PHP, CURL & Tor with apt-get
sudo apt-get install -y apache2 php5 php5-curl tor
Tor creates a proxy on your mashine with port 9050 for SOCKS5 connections.
<?php | |
$ip = '127.0.0.1'; | |
$port = '9051'; | |
$auth = 'PASSWORD'; | |
$command = 'signal NEWNYM'; | |
$fp = fsockopen($ip,$port,$error_number,$err_string,10); | |
if(!$fp) { | |
echo "ERROR: $error_number : $err_string"; |
<?php return array ( | |
'url' => 'https://xaviesteve.com/', | |
'content_type' => 'text/html; charset=UTF-8', | |
'http_code' => 200, | |
'header_size' => 578, | |
'request_size' => 229, | |
'filetime' => -1, | |
'ssl_verify_result' => 0, | |
'redirect_count' => 0, | |
'total_time' => 0.27407799999999999, |
<?php | |
/** | |
* Todo: Send a random user agent string and sleep a random amount between requests. | |
*/ | |
if ($_SERVER['REQUEST_METHOD'] == 'POST') { | |
// Extract and sanatize input: | |
$domain = filter_input(INPUT_POST, 'domain', FILTER_SANITIZE_URL); | |
$terms = filter_input(INPUT_POST, 'terms', FILTER_SANITIZE_STRING); | |
// Setup Goutte (which also includes Guzzle): |
<?php | |
// BELIEVE THIS ONLY WORKS WHEN USING MYSQL | |
// DROP THIS INTO GLOBAL.PHP | |
Validator::extend('columnexists', function($attribute, $value, $parameters) | |
{ | |
$query = DB::select("SHOW COLUMNS FROM " . $parameters[0]); | |
$columns = array(); |
(function() { | |
/** | |
* Bootstrap ng-app. | |
*/ | |
var $injector = angular.injector(['ng']); | |
$injector.invoke(function($http) { | |
$http.get("/auth/csrf_token").then(function(response) { | |
angular.module("app").constant("CSRF_TOKEN", response.csrf_token); | |
angular.bootstrap(document, ['app']); |
<?php | |
//app/libraries/MultiUserProvider.php | |
use Illuminate\Auth\UserProviderInterface, | |
Illuminate\Auth\UserInterface, | |
Illuminate\Auth\GenericUser; | |
class MultiUserProvider implements UserProviderInterface | |
{ | |
/** |
// Back to top Directive | |
angular | |
.module('app.directives') | |
.directive('backToTop', function() { | |
return { | |
restrict: 'E', | |
replace: true, | |
template: '<div class="back-to-top"><i class="fa fa-chevron-up"></i></div>', | |
link: function($scope, element, attrs) { |
<?php | |
# Cron job command for Laravel 4.2 | |
# Inspired by Laravel 5's new upcoming scheduler (https://laravel-news.com/2014/11/laravel-5-scheduler) | |
# | |
# Author: Soren Schwert (GitHub: sisou) | |
# Author: Atef Ben Ali (gitHub: atefBB) | |
# | |
# Requirements: | |
# ============= |
Just migrated it from Codepen.io to markdown. Credit goes to David Conner.
Working with DOM | Working with JS | Working With Functions |
---|---|---|
Accessing Dom Elements | Add/Remove Array Item | Add Default Arguments to Function |
Grab Children/Parent Node(s) | Add/Remove Object Properties | Throttle Functions on Resize |
Create DOM Elements | Conditionals |