Skip to content

Instantly share code, notes, and snippets.

View rosscdh's full-sized avatar

Ross Crawford-d'Heureuse rosscdh

  • Sydney
View GitHub Profile
@rosscdh
rosscdh / jquery.plugin.fluent_comments.js
Created September 20, 2013 13:43
jQuery Plugin upgrade.
'use strict';
/*
Based on django-ajaxcomments, BSD licensed.
Copyright (c) 2009 Brandon Konkle and individual contributors.
Updated to be more generic, more fancy, and usable with different templates.
2013. Updated by Ross Crawford-d'Heureuse to be a jquery.plugin
*/
$(function() {
@rosscdh
rosscdh / gist:47387dc34f963576b4e8
Created July 3, 2015 07:14
giant swarm - error
```
% boot2docker status
running
boot2docker version
Boot2Docker-cli version: v1.7.0
Git commit: 7d89508
```
```
<!DOCTYPE html>
<html>
<head>
<title>{{ COMPANY_NAME }}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<style type="text/css">
/* CLIENT-SPECIFIC STYLES */
body, table, td, a{-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%;} /* Prevent WebKit and Windows mobile changing default text sizes */
@rosscdh
rosscdh / SaltyBiscuit.py
Last active November 10, 2016 15:48
Salt Wrapper
#import requests
from universalclient import Client
class SaltyBiscuit(object):
url = 'http://192.168.99.100:8000/'
salt = None
token = None
def __init__(self, *args, **kwargs):
@rosscdh
rosscdh / json_field.py
Last active June 23, 2025 16:44
PeeWee JSONField
import peewee as pw
class JSONField(pw.TextField):
"""
Class to "fake" a JSON field with a text field. Not efficient but works nicely
"""
def db_value(self, value):
"""Convert the python value for storage in the database."""
return value if value is None else json.dumps(value)
@rosscdh
rosscdh / salt-with-docker.txt
Last active March 10, 2021 14:05
salt with docker
# Start salt-master
docker run -d --name salt-master --hostname salt saltstack/salt:latest salt-master
# Start a minion
docker run --link salt-master --name minion01 saltstack/salt:latest salt-minion
docker run --link salt-master --name minion02 saltstack/salt:latest salt-minion
# List keys
docker exec -it salt-master salt-key -L
@rosscdh
rosscdh / Makefile
Last active May 28, 2021 11:28
docker makefile
.PHONY: all build login push run
NAME := rosscdh/my-project
TAG := $$(git log -1 --pretty=%h)
VERSION := ${NAME}:${TAG}
LATEST := ${NAME}:latest
BUILD_REPO_ORIGIN=$$(git config --get remote.origin.url)
BUILD_COMMIT_SHA1:=$$(git rev-parse --short HEAD)
BUILD_COMMIT_DATE:=$$(git log -1 --date=short --pretty=format:%ct)
[alias]
addremove = !git r && git add . --all
aliases = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\ \t => \\2/' | sort
all = add . --all
amend = !git log -n 1 --pretty=tformat:%s%n%n%b | git commit -F - --amend
br = branch -av
brname = !git branch | grep "^*" | awk '{ print $2 }'
brdel = branch -D
ci = commit
changes = "!f() { git log --pretty=format:'* %s' $1..$2; }; f"
version: '3'
services:
zookeeper:
image: confluent/zookeeper:latest
ports:
- "2181:2181"
# volumes:
# - ./config/kafka/zk.properties:/etc/kafka/zookeeper.properties
### Keybase proof
I hereby claim:
* I am rosscdh on github.
* I am rosscrawford (https://keybase.io/rosscrawford) on keybase.
* I have a public key ASCjtuo71_eDBMUML7tCOdB7hzuTN2pO9QvbgRn2QEXEZgo
To claim this, I am signing this object: