Skip to content

Instantly share code, notes, and snippets.

View papoms's full-sized avatar

Paul Porzky papoms

View GitHub Profile
var casper = require('casper').create();
/* var url = casper.cli.args[0]; */
var url = 'http://kicker.de';
var fn = url.replace(/[^a-z0-9]/gi, '').toLowerCase();
// Settings
var targetWidth = 800; //final Image Size
var targetHeight = 600;
@papoms
papoms / .bash_profile
Last active October 10, 2015 03:17
Bash Prompt Profile
# Bash Prompt
# export PS1="\[\033[0;32m\]\u@\[\033[0;34m\]\h \[\033[1;34m\]\w\[\033[0m\]$ "
export PS1='\[\033[01;32m\]\u\[\033[01;34m\] \w\[\033[31m\]$(git branch 2>/dev/null|cut -f2 -d\* -s)\n\[\033[1;37m\]➜\[\033[00m\] '
# My Path
export PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin/whatweb:$PATH
# LS COLORS
export TERM="xterm-color"
@papoms
papoms / dnsmasq
Created September 17, 2012 17:41
Virtual Doc Root Setup for Mountain Lion
# Install DNSmasq
brew install dnsmasq
# cp default config to the right place
cp /usr/local/Cellar/dnsmasq/2.63/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
# Daemonize
sudo cp /usr/local/Cellar/dnsmasq/2.63/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons/
# Add .dev to the resolver
@papoms
papoms / Click Coordinates
Created November 18, 2014 13:10
Get Click Coordinates based on a normal distribution
<?php
// Return Random Float between min and max
function randomFloat($min = 0, $max = 1) {
return $min + mt_rand() / mt_getrandmax() * ($max - $min);
}
// returns normally distributed coordinates in a given range (0 to nMax)
function getClickCoordinates(&$x, &$y, $xMax = 100, $yMax = 100){
@papoms
papoms / Move to Follow-Up.scpt
Created December 9, 2013 08:44
Outlook mac 2011 - Move to folder Shortcut Action (Automator Workflow)
(*
Original code from http://forgetmenotes.blogspot.com/2011/01/mac-outlook-2011-keyboard-shortcut-to.html
Adapted 2013 by Paul Porzky http://porzky.com
*)
on run {}
tell application "Microsoft Outlook"
-- listSelectedItems : a list of all items selected in Entourage
@papoms
papoms / loadlist.phantom.js
Created August 25, 2012 20:54
load a list of urls with phantomjs
var urls = [
'http://keyworddomains.com',
'http://blog.keyworddomains.com',
'http://timer.keyworddomains.com'
];
var page = require('webpage').create();
function process(){
if (urls.length == 0){
@papoms
papoms / keybase.md
Created March 21, 2019 12:07
Keybase Proof

Keybase proof

I hereby claim:

  • I am papoms on github.
  • I am papoms (https://keybase.io/papoms) on keybase.
  • I have a public key ASAKDds-NANNwLom3V4598Fc6vsoxNwoa3HezTE2h4dlrgo

To claim this, I am signing this object:

@papoms
papoms / fake-referrer.casper.js
Created August 24, 2012 16:10
Fake Referrer with CasperJS
var fakeReferrer = "http://porzky.com"
var targetUrl = "http://keyworddomains.com"
var casper = require('casper').create();
casper.start(fakeReferrer, function() {
this.echo(this.getCurrentUrl());
});
casper.then(function(){
@papoms
papoms / Code.gs
Created April 11, 2015 07:04
Twilio SMS API for Google App Scripts - Send a Textmessage from Google Docs
/**
* Sends a Short Message using the Twilio REST API
*
* It uses UrlFetchApp.fetch to send a POST request with Basic Authentication to the Messages list resource URI
* See https://www.twilio.com/docs/api/rest/sending-sms for documentation of the Twilio Api Call
* See https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app for Documentation on UrlFetchApp
*
* Get Your Api Credentials from https://www.twilio.com/user/account/settings
*
* @param {String} to The Recipients Number e.g. '+1323452345'
@papoms
papoms / change-referrer.demo.phantom.js
Created August 26, 2012 17:03
Try to overwrite window.document.referrer from within phantomjs / onInitialized
var page = require('webpage').create();
page.onConsoleMessage = function (msg) {
console.log('From Page Console: '+msg);
};
page.onInitialized = function() {
page.evaluate(function () {
"use strict";
//The Referrer we want to set