Skip to content

Instantly share code, notes, and snippets.

View simeonpashley's full-sized avatar
🎯
Working for Farnell.com

Simeon Pashley simeonpashley

🎯
Working for Farnell.com
View GitHub Profile
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@simeonpashley
simeonpashley / README
Last active August 29, 2015 14:12 — forked from diemuzi/README
Apache conf w/ fast-cgi
This configuration is a working copy which I have tested on Apache 2.2.x and 2.4.x
I highly recommend you use this version of mod_fastcgi as it works with Apache 2.4.x, fastcgi.com version does not!
https://github.com/ByteInternet/libapache-mod-fastcgi
The fastcgi.com version is 2.4.6, the version I am recommending registers as 2.4.7
To patch mod_fastcgi for use with Apache 2.4.x look at the debian/patches folder. It's not specific to Debian OS so don't let that fool you. I personally use Archlinux.
Of course to compile mod_fastcgi:
@simeonpashley
simeonpashley / move_to_rds.rb
Created October 6, 2015 22:08 — forked from guenter/move_to_rds.rb
A quick and dirty script to move a database into Amazon RDS (or any other database). Can transfer part of the data beforehand.
require 'fileutils'
start_time = Time.now
SOURCE_DB = {
:name => 'db_name',
:user => 'db_user',
:password => 'db_pass',
:host => 'localhost'
Custom `minprice` =
`max(min(DBHistorical, DBGlobalMarketAvg, DBGlobalHistorical, DBRegionMarketAvg, DBRegionHistorical), VendorSell)`
Commonly used Shopping > Price
*OLD*
check(minprice - 100000g, 90% minprice, check(minprice - 50000g, 80% minprice, check(minprice - 10000g, 60% minprice, check(minprice - 5000g, 50% minprice, check(minprice - 1000g, 30% minprice, check(minprice - 500g, 20% minprice))))))
*UPDATED*
[https://www.reddit.com/r/woweconomy/comments/3ax9av/anyone_else_have_a_tsm_sniper_rule_theyre_proud/cterek0/]
@simeonpashley
simeonpashley / install_lua.sh
Created May 2, 2017 13:16
OSX Homebrew Install Lua 5.3, linked as `lua`
#!/bin/bash
brew install lua@5.3
cd /usr/local/bin/
ln -s lua5.3 lua
@simeonpashley
simeonpashley / Untitled-2
Created July 16, 2018 11:02
validateEmail
function validateEmail(email) {
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
@simeonpashley
simeonpashley / Untitled-2
Created July 16, 2018 11:06
create uuid
createUuid: function() {
// Copy & paste form http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript/2117523#2117523
// This is a cryptograhically not secure implementation, but is good enough for the given use case
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
.replace(/[xy]/g, function(c) {
var r = Math.random() * 16|0, v = c == 'x' ? r : (r&0x3|0x8)
return v.toString(16)
})
},
.fx *, .fx::after, .fx::before {
box-sizing: border-box;
}
.fx .dot {
align-items: center;
background-color: rgba(43, 178, 76, 0.38);
border: 1px solid rgba(43, 178, 76, 0.54);
border-radius: 1rem;
box-shadow: 0 1px 10px 0 rgba(0, 0, 0, 0.15);
@simeonpashley
simeonpashley / adwordsShoppingBidderCPA.js
Last active July 17, 2018 18:50
AdWords Shopping Bidder - CPA Target £20
function main() {
var targetCPA = 20;
var productGroupSelector = AdWordsApp
.productGroups()
.withCondition("Impressions > 100")
.forDateRange("LAST_MONTH")
.orderBy("Clicks DESC");
var productGroupIterator = productGroupSelector.get();
@simeonpashley
simeonpashley / AW Script to count ads and keywords in ad groups.js
Created July 17, 2018 18:51
AW Script to count ads and keywords in ad groups.js
function main() {
var adGroupIterator = AdWordsApp.adGroups().withCondition('Status = ENABLED').withCondition('CampaignStatus = ENABLED').get();
while (adGroupIterator.hasNext()) {
var adGroup = adGroupIterator.next();
// Keyword Checks
var keywordIterator = adGroup.keywords().withCondition('Status = ENABLED').get();
var numKeywords = keywordIterator.totalNumEntities();
if(numKeywords >= 15) {
var campaignName = adGroup.getCampaign().getName();
var adGroupName = adGroup.getName();