Skip to content

Instantly share code, notes, and snippets.

View toast38coza's full-sized avatar

Christo Crampton toast38coza

View GitHub Profile

Unit Tests in Vue.js

Tooling

{
  "karma-mocha": "^0.2.1",
  "karma-chai": "^0.1.0",
  "karma-chai-as-promised": "^0.1.2",
  "karma-sinon": "^1.0.4",
@rvanbruggen
rvanbruggen / 1-loadolympics.cql
Last active August 25, 2016 17:00
Olympic Medallists
create index on :Country(name);
create index on :City(name);
create index on :Sport(name);
create index on :Discipline(name);
create index on :Athlete(name);
create index on :Event(name);
create index on :Year(name);
create index on :Gender(name);
create constraint on (c:Country) assert c.noc is unique;
@puppybits
puppybits / docker-compose.yml
Last active September 5, 2020 08:35 — forked from andrefreitas/docker-compose.yml
sentry docker-compose
redis:
image: redis
postgres:
image: postgres
environment:
- POSTGRES_PASSWORD=sentry
- POSTGRES_USER=sentry
volumes:
- /var/lib/postgresql/data
@hazanjon
hazanjon / jekyll.conf
Created January 31, 2014 01:53
Ubuntu Upstart file for Jekyll server
description "Jekyll node.js server"
author "Jon Hazan<[email protected]>"
env USER=www-data
env SITENAME=yoursite.com
env SITEDIR=/var/www/yoursite.com/
env JEKYLL=/usr/local/bin/jekyll
#Make sure mounting is completed before starting
start on started mountall
@jctanner
jctanner / gist:8229044
Last active January 2, 2016 01:18
CELERY + REDIS EXAMPLE
#!/usr/bin/python
####################
# ansiblecaller.py
####################
import os
import sys
import subprocess
import shlex
@eerien
eerien / forms.py
Last active May 12, 2024 11:20
Comma Separated Values Form Field for Django. There are CommaSeparatedCharField, CommaSeparatedIntegerField.
from django import forms
from django.core import validators
from django.core.exceptions import ValidationError
class MinLengthValidator(validators.MinLengthValidator):
message = 'Ensure this value has at least %(limit_value)d elements (it has %(show_value)d).'
class MaxLengthValidator(validators.MaxLengthValidator):
message = 'Ensure this value has at most %(limit_value)d elements (it has %(show_value)d).'
@nicksnell
nicksnell / wsgi.py
Created August 8, 2012 21:19
HTTP Auth for Django w/ Barrel
"""WSGI application file"""
import os
from django.core.wsgi import get_wsgi_application
from barrel import cooper
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
django_app = get_wsgi_application()
@davidalexander
davidalexander / gist:1086455
Last active July 12, 2024 07:05
Magento Snippets

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@JasonGiedymin
JasonGiedymin / Advanced Django 1.3.x+ Logging
Created March 25, 2011 18:47
A Django 1.3.x+ settings.py snippet with Advanced logging formatters using RFC 2822, TimedRotatingFileHandler, and a WatchedFileHandler.
#
# Advanced Django 1.3.x+ Logging
#
# Author:
# Jason Giedymin < jasong _[_a-t_]_ apache d-o-t org >
#
# Description:
# A Django 1.3.x+ settings.py snippet with Advanced logging formatters using RFC 2822,
# TimedRotatingFileHandler, and a WatchedFileHandler.
#
import base64
import hashlib
import hmac
import simplejson as json
def base64_url_decode(inp):
padding_factor = (4 - len(inp) % 4) % 4
inp += "="*padding_factor
return base64.b64decode(unicode(inp).translate(dict(zip(map(ord, u'-_'), u'+/'))))