Skip to content

Instantly share code, notes, and snippets.

View wdmtech's full-sized avatar

Will Murray wdmtech

  • UK
View GitHub Profile
@aparajita
aparajita / hosts
Created February 23, 2019 19:03
hosts file entries to block Facebook
# Block facebook!
0.0.0.0 static.ak.fbcdn.net
0.0.0.0 www.connect.facebook.net
0.0.0.0 www.facebook.com
0.0.0.0 www.fbcdn.com
0.0.0.0 www.fbcdn.net
0.0.0.0 www.graph.facebook.com
0.0.0.0 www.login.facebook.com
0.0.0.0 www.s-static.ak.facebook.com
0.0.0.0 www.static.ak.connect.facebook.com
@carbontwelve
carbontwelve / EloquentRepository.php
Last active May 30, 2018 11:20
Repository pattern for woogle
<?php namespace Photogabble\Database;
use Illuminate\Database\Eloquent\Model;
class EloquentRepository
{
/** @var \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Query\Builder */
protected $model;
public function __construct($model = null)
@sadikaya
sadikaya / cmder-in-webstorm.md
Created November 28, 2016 06:52
Cmder inside Webstorm terminal
  1. Set an environment variable called CMDER_ROOT to your root Cmder folder (in my case C:\Program Files (x86)\Cmder). It seems to be important that this does not have quotes around it because they mess with concatenation in the init script.
  2. In your IntelliJ terminal settings, use "cmd" /k ""%CMDER_ROOT%\vendor\init.bat"" as the Shell path. The double-double-quotes are intentional, as they counteract the missing double quotes in the environment variable.
@zrrrzzt
zrrrzzt / sitemap-to-objects.js
Created December 18, 2015 22:30
Quick and dirty node.js module for parsing a sitemap.xml to objects via a streaming interface
var saxStream = require('sax').createStream(true, {trim: true})
var hh = require('http-https')
var streamify = require('streamify')
var stream = streamify()
var url = 'https://raw.githubusercontent.com/zrrrzzt/sitemap-to-array/master/test/data/sitemap.xml'
var list = []
function objectFromArray (arr) {
var obj = {}
@allebb
allebb / web.config
Last active March 10, 2022 05:26
Laravel 5.x web.config file for Windows Azure hosting
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="true"/>
<staticContent>
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<clientCache httpExpires="Sun, 29 Mar 2020 00:00:00 GMT" cacheControlMode="UseExpires" />
</staticContent>
@mabasic
mabasic / helpers.php
Last active May 10, 2024 19:25
config_path function for Lumen framework
<?php
if ( ! function_exists('config_path'))
{
/**
* Get the configuration path.
*
* @param string $path
* @return string
*/
@irazasyed
irazasyed / laravel-version.php
Last active October 10, 2017 08:16
PHP: Check if Laravel version is 4 in Service Provider. To be used in Service Providers.
<?php
/**
* Laravel Version Check
*
* @return bool
*/
private function isLaravel4()
{
return version_compare(get_class($this->app) . '::VERSION', '5', '<');
@leto
leto / gist:97e7c15cc4ff3b700d5a
Last active August 29, 2015 14:15
Example vagrant-aws config
config.vm.define "dev" do |dev|
config.vm.box = "dummy"
dev.vm.provider :aws do |aws, override|
override.vm.provision :shell, :path => "scripts/aws_provision.sh"
override.ssh.private_key_path = 'foo.pem'
override.vm.hostname = "foo.com"
override.ssh.username = "ubuntu"
aws.access_key_id = "REALLY SECRET DONT TELL..."
aws.secret_access_key = "asdf",
aws.keypair_name = "foo dev"
@andrealbinop
andrealbinop / setup-modernie-vagrant-boxes.md
Last active May 28, 2023 01:54
Setup modern.ie vagrant boxes

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites