Skip to content

Instantly share code, notes, and snippets.

View ojengwa's full-sized avatar
🏠
Working from home

Bernard Ojengwa ojengwa

🏠
Working from home
View GitHub Profile
@ojengwa
ojengwa / docker-compose2aws
Last active January 18, 2024 17:58
Set by step guide on deploying your docker containers to AWS using docker-compose and docker-machine
# Deploy to AWS using docker-machine and docker-compose
## 1. Prepare your machine
Please follow this steps:
1.1 Install docker in your localhost. [Installation link](https://docs.docker.com/engine/installation/)
1.2 Install docker-machine in your localhost. [Installation link](https://docs.docker.com/compose/install/)
1.3 Install docker-compose in your localhost. [Installation link](https://docs.docker.com/machine/install-machine/)
1.4 Create an account in AWS (skip this step if you already have one). [AWS](https://aws.amazon.com/)
@ojengwa
ojengwa / DJANGO_TWISTED_HAPROXY.md
Created February 26, 2017 04:35 — forked from sspross/DJANGO_TWISTED_HAPROXY.md
Serving Django and Twisted using HAproxy

Serving Django and Twisted using HAproxy

Why?

Because we wanted to achive the following while developing a webapp using websockets:

Static serving (nginx), Django application (gunicorn) and Websockets service (twisted)

  • on the same IP
@ojengwa
ojengwa / deploy_with_ebcli3_on_circleci.md
Created January 15, 2017 01:19 — forked from RobertoSchneiders/deploy_with_ebcli3_on_circleci.md
Settings to deploy to AWS Elastic Beanstalk on CircleCi (EB Cli 3)

This is how I configured the deploy of my rails apps to AWS Elastic Beanstalk through CircleCI.

Configure Environments Variables

On Project Settings > Environment Variables add this keys:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
    The aws user must have the right permissions. This can be hard, maybe, this can help you.

Create a bash script to create the eb config file

from __future__ import absolute_import, unicode_literals
from celery import current_app
from celery.bin import worker
if __name__ == '__main__':
app = current_app._get_current_object()
worker = worker.worker(app=app)
const Sequelize = require('sequelize');
const models = require('./models');
const fs = require('fs');
// delete models.default;
const sequelize = new Sequelize(
'',
'',
'', {
@malarkey
malarkey / Contract Killer 3.md
Last active May 17, 2024 15:28
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@ogorzalka
ogorzalka / jquery.responsiveCanvas.js
Created May 29, 2012 08:53
Make Canvas Responsive !
(function($) {
$.fn.responsiveCanvas = function(method) {
var methods = {
// init functions
init : function(options) {
return this.each(function(i) {
var c = this, // THE canvas
ct = c.getContext('2d'), // check the context
$container = $(c).parent(); // parent container object