Skip to content

Instantly share code, notes, and snippets.

View opensussex's full-sized avatar

Graham Holden opensussex

View GitHub Profile
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
@opensussex
opensussex / private.xml
Last active February 19, 2016 12:45
private.xml for karabiner to swap backquote with backslash needed for wasd keyboard on a mac.
<?xml version="1.0"?>
<root>
<item>
<name>Swap backslash and backquote key.</name>
<identifier>private.backslash_to_backquote</identifier>
<autogen>__KeyToKey__ KeyCode::DANISH_DOLLAR, KeyCode::BACKQUOTE</autogen>
<autogen>__KeyToKey__ KeyCode::BACKQUOTE, KeyCode::DANISH_DOLLAR</autogen>
</item>
zend_extension=xdebug.so
xdebug.remote_enable=On
xdebug.remote_handler="dbgp"
xdebug.remote_port=9000
xdebug.remote_autostart = 1
xdebug.idekey = "netbeans-xdebug"
xdebug.remote_connect_back=on
@opensussex
opensussex / Vagrant
Last active July 12, 2016 08:14
vagrant box.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@opensussex
opensussex / packages.txt
Created August 1, 2016 15:00
atom packages
atom-php-navigation
autocomplete-elixir
autocomplete-php
git-blame
git-diff-details
git-history
git-time-machine
language-elixir
linter
linter-phpcs
<?php
use GuzzleHttp\Client;
class TextMarketer
{
private $username;
private $password;
private $orig;
@opensussex
opensussex / diff.rb
Created December 23, 2016 11:55
a very basic example of using the Diffy library to do a diff on two files.
require ('diffy')
#uses the Diffy library - https://github.com/samg/diffy
file_1, file_2 = ARGV;
file_1_text = open(file_1)
file_2_text = open(file_2)
puts Diffy::Diff.new(file_1_text.read, file_2_text.read)
<?php
$yodiz_columns = [
[
'title'=>'Position',
'from_done_done' =>2
],
[
'title'=>'Id',
'from_done_done'=>2,
@opensussex
opensussex / tax.ex
Created April 10, 2018 19:43
example of some elixir anonymous function
apply_tax = fn price -> tax = (price * 0.12); total = price + tax;IO.puts "Price: #{total} - Tax: #{tax}" end;
Enum.each [12.5, 30.99, 250.49, 18.80], apply_tax
@opensussex
opensussex / match_stick_factory.ex
Last active April 11, 2018 11:41
having a go at creating a module to work out the number of boxes are needed for the number of matches past in - this is for the learning functional programming with elixir book
defmodule MatchStickFactory do
def boxes(number_of_matches) do
number_of_matches_in_big = 50;
number_of_matches_in_medium = 20;
number_of_matches_in_small = 5;
number_of_matches_remaining = number_of_matches;
{number_of_big_boxes, number_of_matches_remaining} = divide(number_of_matches_remaining, number_of_matches_in_big)
{number_of_medium_boxes, number_of_matches_remaining} = divide(number_of_matches_remaining, number_of_matches_in_medium)
{number_of_small_boxes, number_of_matches_remaining} = divide(number_of_matches_remaining, number_of_matches_in_small)