Skip to content

Instantly share code, notes, and snippets.

View LewisW's full-sized avatar

Lewis LewisW

  • UK
View GitHub Profile
@textarcana
textarcana / mac_xwindows_x11_xvfb_headless_firefox_howto.md
Last active April 19, 2023 01:53
Headless Selenium on CentOS 6.3 (Mac XWindows / X11 / Xvfb / Headless Firefox / Selenium howto)

XWindows for Headless Selenium

X Wing art by Paul Harckham

How to set up a Headless Selenium Testing environment for CentOS 6.3.

On your CentOS 6.3 host

Follow these steps to set up a CentOS 6.3 host to run headless Selenium tests with Firefox.

@matteocaberlotto
matteocaberlotto / deploy-symfony.sh
Last active April 20, 2022 14:51
Deploy symfony 2+ applications (multiple environment)
#!/bin/bash
# include config
# config example below:
#
#
# Example deploy_config.sh
#
# dev_env() {
@mlocati
mlocati / color-scale.js
Last active January 15, 2025 16:07
Javascript color scale from 0% to 100%, rendering it from red to yellow to green
// License: MIT - https://opensource.org/licenses/MIT
// Author: Michele Locati <[email protected]>
// Source: https://gist.github.com/mlocati/7210513
function perc2color(perc) {
var r, g, b = 0;
if(perc < 50) {
r = 255;
g = Math.round(5.1 * perc);
}
else {
@labs-scnm
labs-scnm / .htaccess
Created November 29, 2013 15:29 — forked from michaelhagedon/.htaccess
A modified Symfony2 .htaccess file that makes it possible to set the front controller from the Apache virtual host (kind of like Rails).
<IfModule mod_rewrite.c>
RewriteEngine On
### Call the correct front controller. This is dependent on an environment variable being set
### in the virtual host configuration. SetEnv seems not to work, so here's an example with SetEnvIfNoCase:
### <Directory /path/to/application/web>
### SetEnvIfNoCase REQUEST_URI .* SYMFONY_ENV=dev
### </Directory>
### This will force the following rules to call the dev front controller.
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active November 27, 2024 13:36
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@christopher-hopper
christopher-hopper / vm-resize-hard-disk.md
Last active August 15, 2024 15:16
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@xbeta
xbeta / README.md
Last active April 19, 2025 13:29
Macbook Pro Bluetooth + WiFi 2.4GHz interference fix for Mavericks
@jvenator
jvenator / gist:9672772a631c117da151
Last active April 25, 2025 17:44
PDFtk Server Install Workaround for Mac OS X

Installing PDFtk Server edittion on your Mac

This workaround install is necessary because PDFtk was pulled from homebrew-cask due to issues with it aggressively overwriting file permissions that could impact other installed libraries. See this homebrew-cask issue.
The following steps worked on Mac OS X 10.10.1 with a standard brew installation for the PDFtk Mac OS X server libary version 2.02.
All Terminal commands separated by a full line space. Some commands wrap into multiple lines.

Download and extract the Mac OS X server install pacakge

Return new ArrayCollections from getters

Do you have some business logic tied up in your adder methods? Something like this maybe.

class Cart
{
	private $items;

	public function __construct()
@stevenocchipinti
stevenocchipinti / remote.xml
Created April 4, 2015 11:37
Kodi remote debugging keymap
<!--
kindly provided by 'Knapster'
Ref: http://forum.kodi.tv/showthread.php?tid=139145&pid=1285390#pid1285390
-->
<keymap>
<global>
<remote>
<channelplus>Notification(Keypress, channelplus, 1)</channelplus>
<channelminus>Notification(Keypress, channelminus, 1)</channelminus>