Skip to content

Instantly share code, notes, and snippets.

View prezire's full-sized avatar

Mark N. Amoin prezire

View GitHub Profile
@prezire
prezire / docker-compose.yml
Created June 24, 2023 03:02 — forked from nnattawat/docker-compose.yml
Docker setup for Drupal with bootstrap theme
version: "2"
services:
drupal:
build:
context: .
dockerfile: drupal.Dockerfile
image: custom-drupal
ports:
- 8080:80
@prezire
prezire / django_cheat_sheet.md
Created March 25, 2021 12:16 — forked from bradtraversy/django_cheat_sheet.md
Django command cheat sheet

Django 2.x Cheat Sheet

Creating a virtual environment

We need to create a virtual env for our app to run in: More Here Run this command in whatever folder you want to create your venv folder

python -m venv ./venv
@prezire
prezire / django_deploy.md
Created March 25, 2021 08:50 — forked from bradtraversy/django_deploy.md
Django Deployment - Digital Ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.

#!/usr/bin/php-zts
<?php
# By: https://github.com/zheltikov
# Used in: https://www.youtube.com/watch?v=L_FdpmJatdw
# Define a custom Thread class
class MyThread extends Thread {
private $name = "";
private $duration = 0;
#!/bin/bash
# By: https://github.com/zheltikov
# Based on: http://blog.programster.org/ubuntu16-04-compile-php-7-2-with-pthreads
# Used in: https://www.youtube.com/watch?v=L_FdpmJatdw
# Download the necessary packages
sudo apt update
sudo apt install libzip-dev bison autoconf build-essential pkg-config git-core libltdl-dev libbz2-dev libxml2-dev libxslt1-dev libssl-dev libicu-dev libpspell-dev libenchant-dev libmcrypt-dev libpng-dev libjpeg8-dev libfreetype6-dev libmysqlclient-dev libreadline-dev libcurl4-openssl-dev
@prezire
prezire / git-log-live
Last active January 22, 2019 03:21 — forked from tlberglund/git-loglive
Log Live Git Command
#!/bin/bash
#sudo ln -s /full-path/git-log-live /usr/local/bin/git-log-live
#sudo chmod +x git-log-live
#git-log-live /absolute-proj-root-path
#git-log-live .
while :
do
clear
@prezire
prezire / php-event-listener-example.php
Created March 6, 2018 03:07 — forked from im4aLL/php-event-listener-example.php
PHP event listener simple example
<?php
class Event {
private static $events = [];
public static function listen($name, $callback) {
self::$events[$name][] = $callback;
}
public static function trigger($name, $argument = null) {
foreach (self::$events[$name] as $event => $callback) {
@prezire
prezire / instructions.sh
Created February 24, 2018 06:16 — forked from james2doyle/instructions.sh
Setup beanstalkd on AWS EC2 with Ubuntu 16.04 to be public
sudo vim /etc/default/beanstalkd # change IP to 0.0.0.0
sudo systemctl daemon-reload # reload daemon
netstat -nat | grep LISTEN # see if `0.0.0.0:11300` is in the list
@prezire
prezire / autobahn.js
Created February 13, 2018 06:00 — forked from cboden/autobahn.js
Autobahn v1
/** @license MIT License (c) 2011,2012 Copyright Tavendo GmbH. */
/**
* AutobahnJS - http://autobahn.ws
*
* A lightweight implementation of
*
* WAMP (The WebSocket Application Messaging Protocol) - http://wamp.ws
*
* Provides asynchronous RPC/PubSub over WebSocket.