Skip to content

Instantly share code, notes, and snippets.

View CraigChilds94's full-sized avatar
🌪️
Craignado

Craig Childs CraigChilds94

🌪️
Craignado
View GitHub Profile
@CraigChilds94
CraigChilds94 / color.go
Last active September 13, 2024 06:04
Hex to RGB conversion in Go
package main
import (
"fmt"
"strconv"
)
type Hex string
type RGB struct {
@CraigChilds94
CraigChilds94 / proxy.js
Created November 15, 2017 12:59
Object Proxy-ing
var myObject = {
testing: 'Hello',
};
var myProxiedObject = new Proxy(myObject, {
get: function(target, prop) {
console.log({ type: 'get', target, prop });
return Reflect.get(target, prop);
},
set: function(target, prop, value) {
@CraigChilds94
CraigChilds94 / jquery-svg.js
Created February 1, 2018 18:36
jQuery SVG replacement plugin
$.fn.SVG = function() {
var $img = $(this);
var imgID = $img.attr('id');
var imgClass = $img.attr('class');
var imgURL = $img.attr('src');
return new Promise(function(resolve, reject) {
$.get(imgURL, function(data) {
// Get the SVG tag, ignore the rest
var $svg = $(data).find('svg');
@CraigChilds94
CraigChilds94 / README.md
Created June 11, 2018 16:10
Running Twofishes with Docker

Place the Docker Compose config file in the root of a project folder.

Ensure you've got your Docker Machine setup to use a large amount of memory, try 8GB.

Then run docker-compose up.

Once you've seen the serving http/json on port 8081 message come up, run curl http://0.0.0.0:8081/\?query\=Twatt,Scotland