Skip to content

Instantly share code, notes, and snippets.

View alexwilson's full-sized avatar
🎧
i only speak techno.

Alex Wilson alexwilson

🎧
i only speak techno.
View GitHub Profile
@alexwilson
alexwilson / clean-docker.sh
Created August 6, 2016 20:12
Docker cleanup
#!/bin/sh
# Sourced from https://github.com/jfrazelle/dotfiles/blob/a7fd3df6ab423e6dd04f27727f653753453db837/.dockerfunc#L8-L11
docker rm -v $(docker ps --filter status=exited -q 2>/dev/null) 2>/dev/null
docker rmi $(docker images --filter dangling=true -q 2>/dev/null) 2>/dev/null
@alexwilson
alexwilson / ga.js
Last active May 20, 2016 20:46
ga.js-style wrapper for compatibility with Google Tag Manager
(function() {
var _prefix = 'ga';
// Ensure we have a GTM Data Layer to push to.
window['dataLayer'] = window['dataLayer'] || {};
// Instead of overdeclaring _gaq, only attempt to polyfill if it doesn't already exist.
if (window['_gaq'] === 'undefined '|| typeof window['_gaq'] !== 'object') {
window['_gaq'] = {};
@alexwilson
alexwilson / ezpublish.yml
Last active March 10, 2016 08:34
How to use literal HTML in eZ Platform
## Path can point wherever, this currently assumes that you're whacking everything in /ezpublish/
## but really this should be in a bundle.
system:
some_siteaccess_name:
fieldtypes:
ezxml:
custom_tags: [{path: %kernel.root_dir%/Resources/views/fields/ezxml/fields.xsl}]
@alexwilson
alexwilson / devServer.js
Created January 22, 2016 12:39
Is this doing it right?
import webpack from "webpack";
import WebpackDevServer from "webpack-dev-server";
import config from "./webpack.config";
const host = 'localhost';
const port = 9080;
config.devtool = 'eval';
config.entry.push('webpack-dev-server/client?http://'+host+':'+port);
config.entry.push('webpack/hot/only-dev-server');
@alexwilson
alexwilson / Skype for Web theme
Last active August 29, 2015 14:17
Change formatting.
@-moz-document url-prefix("https://web.skype.com/en/")
{
.swx.themeBlue,
.swx .themeBlue,
.swx .themeWhite.side .recent.active
{
background-color: #cccccc !important;
fill: #00aff0 !important;
color: #ffffff !important;
@alexwilson
alexwilson / cloudflare-challenge.js
Last active September 3, 2021 17:23
This is a project designed to get around sites using Cloudflare's "I'm under attack" mode. Using the PhantomJS headless browser, it queries a site given to it as the second parameter, waits six seconds and returns the cookies required to continue using this site. With this, it is possible to automate scrapers or spiders that would otherwise be t…
/**
* This is a project designed to get around sites using Cloudflare's "I'm under attack" mode.
* Using the PhantomJS headless browser, it queries a site given to it as the second parameter,
* waits six seconds and returns the cookies required to continue using this site. With this,
* it is possible to automate scrapers or spiders that would otherwise be thwarted by Cloudflare's
* anti-bot protection.
*
* To run this: phantomjs cloudflare-challenge.js http://www.example.org/
*
* Copyright © 2015 by Alex Wilson <antoligy@antoligy.com>
@alexwilson
alexwilson / csvgen.php
Created September 29, 2014 10:26
Magento CSV generator
<?php
class csvgen {
public $count;
private $cwd;
private $products;
private $dateTime;
public function __construct() {
@alexwilson
alexwilson / fanfictionnet.js
Created September 29, 2014 10:23
Select text from FanFiction.net
$("#storytextp").css{
'-webkit-touch-callout': 'text',
'-webkit-user-select': 'text',
'-khtml-user-select': 'text',
'-moz-user-select': 'text',
'-ms-user-select': 'text',
'user-select': 'text'
};