Skip to content

Instantly share code, notes, and snippets.

Avatar
🤓

Lewis Cowles Lewiscowles1986

🤓
View GitHub Profile
@Lewiscowles1986
Lewiscowles1986 / Vagrantfile
Last active Mar 2, 2020
Magento 2 (Stable) Vagrant
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "debian/jessie64"
config.vm.network "private_network", ip: "10.0.0.7"
config.vm.hostname = "magento2.local"
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
@Lewiscowles1986
Lewiscowles1986 / Dockerfile
Last active Jan 3, 2020
Bigcommerce Stencil Dockerfile
View Dockerfile
FROM ubuntu:xenial
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN apt-get update -qq
RUN apt-get install -y -qq git curl python python-pip build-essential
RUN pip install virtualenv
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 4.1.2
View fullstory-org-code-js-input-helper.part.html
<script type="text/javascript">
(function() {
/*
* Helper to extract FullStory Org code from URL when used in a HTML input element
*/
const SCHEME_INDICATOR = '://';
const URL_PATH_SEPARATOR = '/';
const FULLSTORY_DOMAIN_INDICATOR = 'app.fullstory.com';
document.querySelector('#fullstory_org_code').addEventListener('input', function(event) {
@Lewiscowles1986
Lewiscowles1986 / script.js
Last active Nov 10, 2019
Prev Next JS injection
View script.js
/*
* Used via https://chrome.google.com/webstore/detail/user-javascript-and-css/nbhcbdghjpllgmfilhnhkllmkecfmpld
* to embed JS in all web-pages that are compliant to enable keyboard-navigation of blog posts
*/
(function() {
window.addEventListener('keydown', function(e) {
switch(e.key) {
case 'Left': // IE11 BS
case 'ArrowLeft':
var link = document.querySelector('a[rel="prev"], .prev, #previtem');
View .bashrc
export EDITOR="code --wait"
# export EDITOR="codium --wait"
# export EDITOR="atom --wait"
# export EDITOR="nano --wait"
# export EDITOR="vi --wait"
# export EDITOR="sublime --wait"
@Lewiscowles1986
Lewiscowles1986 / rPi3-php7-setup.sh
Last active Nov 8, 2019
Raspberry Pi PHP7, Nginx 1.9 Installer
View rPi3-php7-setup.sh
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
apt-get update -y
apt-get upgrade -y
apt-get dist-upgrade -y
@Lewiscowles1986
Lewiscowles1986 / redirection.function.php
Last active Oct 24, 2019
PHP Redirect PHP, JS, HTML Meta Tag
View redirection.function.php
<?php
const OPTION_DEFAULTS = [
'lang' => 'en',
'meta' => true,
'js' => true,
'title' => 'Redirection notice',
'link_sentence' => 'If you are not redirected automatically, follow <a href="%s">%s</a>',
'link_label' => 'this link',
'head_extra' => '<link rel="stylesheet" href="/css/style.css" />',
@Lewiscowles1986
Lewiscowles1986 / ra-7601U-USB-build-inst.sh
Last active Sep 3, 2019
install ralink 7601U USB N+150 wireless driver (Ubuntu 14.04 or Kernel 3.13+)
View ra-7601U-USB-build-inst.sh
#!/bin/sh
#setup dependencies
sudo apt-get install --reinstall linux-headers-generic build-essential
#get patched drivers
wget http://www.lewiscowles.co.uk/dls/MT7601U-14.04-patched.tar -O - | tar -x
cd MT7601U-14.04-patched
# build and install
@Lewiscowles1986
Lewiscowles1986 / README.md
Last active Apr 17, 2019
Playstation 2 EU USB "The Buzz" controller
View README.md

"The Buzz" Playstation 2 EU USB controller

Using tool "Simple HID Write"

  • W: Write
  • R: Read
W 00 {FF} 00 00 00 // controller 1 red light activate
W 00 {00} 00 00 00 // controller 1 red light deactivate
@Lewiscowles1986
Lewiscowles1986 / script.js
Created May 20, 2018
Anonymous Upload images to Imgur V3 JS
View script.js
var ImgurAPIKey = 'YEAH-IM-NOT-GIVING-THAT';
window.addEventListener('paste', function(e) {
function eventPreventDefault(e) {
e.preventDefault();
}
function getClipboardData(e) {
return window.clipboardData || e.clipboardData;
}
You can’t perform that action at this time.