Skip to content

Instantly share code, notes, and snippets.

View AzMoo's full-sized avatar

Matt Magin AzMoo

  • Adelaide, Australia
View GitHub Profile
@AzMoo
AzMoo / beat_poem.py
Last active August 30, 2015 11:08
A test gist to write I beat poem I stole from here: http://blog.trinket.io/writing-poetry-in-python/
from random import choice, randint
## Beat poetry
adjectives = "radiant bright ecstatic young lithe driving running splitting".split()
verbs = "wriggles grows stares saunters drives smiles raps".split()
nouns = "pen inkwell willow sky station train pane window sunlight dust".split()
def beat_poem():
print "\n" + "="*16+" a poem " + "="*16
@AzMoo
AzMoo / django_secret_key.rb
Created September 8, 2015 00:23
Puppet Django Secret Key
module Puppet::Parser::Functions
newfunction(:django_secret_key) do |args|
chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$^&*(-_=+)'
password = ''
50.times { password << chars[rand(chars.size)] }
return password
end
end
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def replicate_company(apps, schema_editor):
"""
THIS FUNCTION IS BROKEN
# filename: happy_birthday.py
"""A basic (single function) API written using hug"""
import hug
@hug.type(extend=hug.types.number)
def extend_test(value):
print(value)
var fs = require('fs');
fs.readFile('notarealfile', 'utf8', function(err, data){
try {
var config = JSON.parse(data);
} catch(e) {
console.log(e);
}
});
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
[fleet_cmv@cmvfleet ~]$
[fleet_cmv@cmvfleet ~]$
[fleet_cmv@cmvfleet ~]$
[fleet_cmv@cmvfleet ~]$ pip install pip --upgrade --user
Downloading/unpacking pip from https://pypi.python.org/packages/9c/32/004ce0852e0a127f07f358b715015763273799bd798956fa930814b60f39/pip-8.1.2-py2.py3-none-any.whl#md5=0570520434c5b600d89ec95393b2650b
Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB): 1.2MB downloaded
Installing collected packages: pip
Successfully installed pip
Cleaning up...
[fleet_cmv@cmvfleet ~]$
image: alpine
before_script:
- apk add openssh --update
deploy:
stage: deploy
script:
- mkdir -p ~/.ssh
- echo -e $SSH_KNOWN_HOSTS > ~/.ssh/known_hosts
@AzMoo
AzMoo / index.js
Created September 26, 2016 00:31
if(window.location.pathname == '/vehicles/standard-fields/') {
require.ensure(['./vehicles/standard-fields/main'], function(require){
var standard_fields = require('./vehicles/standard-fields/main')
standard_fields.default()
})
} else if(window.location.pathname == '/service/bom-builder/') {
require.ensure(['./service/bom-builder/main'], function(require){
var bom_builder = require('./service/bom-builder/main')
bom_builder.default()
var webpack = require("webpack")
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: ['bootstrap-loader', 'clipboard', 'whatwg-fetch', 'es6-promise', "./js"],
output: {
path: "./dealerpro_helpers/static/build/",
filename: "bundle.js",
publicPath: "/static/build/"
},