Skip to content

Instantly share code, notes, and snippets.

@JensVerneuer
JensVerneuer / bulk-create-fields
Created Jul 10, 2017
Create aws athena table for cloudfront logs
View bulk-create-fields
date date,time string,location string,bytes int,request_ip string,method string,host string,uri string,status int,referer string,useragent string,uri_query string,cookie string,edge_type string,edget_requiest_id string,host_header string,cs_protocol string,cs_bytes int,time_taken string,x_forwarded_for string,ssl_protocol string,ssl_cipher string,result_type string,protocol string
@JensVerneuer
JensVerneuer / scroll2like
Created May 8, 2017
Like all posts on your Facebook timeline
View scroll2like
// it's pretty obvious, that facebook will block you in case you use this - right?
function scroll2like(){
let scrollActions = 10;
let scrollBy = 1000;
let scrollDelay = 1000;
let scrollDelayHelper = 0;
while(--scrollActions) {
scrollDelayHelper = scrollDelayHelper+scrollDelay
setTimeout(function scroll(){
@JensVerneuer
JensVerneuer / reroute
Created Apr 20, 2017
reroute port 9000 to 80 using iptables
View reroute
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 9000
iptables-save
@JensVerneuer
JensVerneuer / nginx.conf
Created Aug 29, 2016
Remove/Add tailing slash nginx
View nginx.conf
# add trailing slash
rewrite ^(.*[^/])$ $1/ permanent;
# Remove trailing slash
rewrite ^/(.*)/$ /$1 permanent;
View README.md

Here are a list of headless browsers that I know about:

  • [HtmlUnit][1] - Java. Custom browser engine. JavaScript support/DOM emulated. Open source.
  • [Ghost][2] - Python only. WebKit-based. Full JavaScript support. Open source.
  • [Twill][3] - Python/command line. Custom browser engine. No JavaScript. Open source.
  • [PhantomJS][4] - Command line/all platforms. WebKit-based. Full JavaScript support. Open source.
  • [Awesomium][5] - C++/.Net/all platforms. Chromium-based. Full JavaScript support. Commercial/free.
  • [SimpleBrowser][6] - .Net 4/C#. Custom browser engine. No JavaScript support. Open source.
  • [ZombieJS][7] - Node.js. Custom browser engine. JavaScript support/emulated DOM. Open source.
  • [EnvJS][8] - JavaScript via Java/Rhino. Custom browser engine. JavaScript support/emulated DOM. Open source.
View Path to php ini
/usr/share/php5/php.ini-development
bont forget to sudo editor!
sudo vi /usr/share/php5/php.ini-development
sudo vi /usr/share/php5/php.ini-development
View ios-web-app.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="yes" name="apple-mobile-web-app-capable">
<title>iOS Web App</title>
<!-- iPhone -->
View wp_custom_usr_login
<?php
if($_POST){
//We shall SQL escape all inputs
$username = $wpdb->escape($_REQUEST['username']);
$password = $wpdb->escape($_REQUEST['password']);
$remember = $wpdb->escape($_REQUEST['rememberme']);
if($remember) $remember = "true";
else $remember = "false";
$login_data = array();
@JensVerneuer
JensVerneuer / eachQuerySelectorAll
Last active Dec 19, 2015
Arguments are: selector: a css selector for the dom Elements Argument type: string callback: the function wich will be called for every matched element first argument is the Element with Type DOM Node Argument type: function domScope: (optional) part of the dom where to search, default is document Argument type: DOM node (object)
View eachQuerySelectorAll
var eachQuerySelectorAll = function(selector, callback, domScope){
if(typeof(domScope==="undefined")){
domScope = window.document;
}
if(typeof(callback)==="undefined"){
return false;
}
if(typeof(selector)!=="string"){
return false;
}
@JensVerneuer
JensVerneuer / isMobileSafari
Last active Dec 19, 2015
Regex to detect mobile Safari
View isMobileSafari
/iPhone|iPod|iPad/;
You can’t perform that action at this time.