Skip to content

Instantly share code, notes, and snippets.


Oshane Bailey b4oshany

View GitHub Profile
b4oshany / main.ini.php
Created Dec 27, 2014
Sample main.ini.php file of Vecni-PHP
View main.ini.php
# define package usage
use libs\vecni\http\Response;
use libs\vecni\http\Request;
use libs\vecni\Vecni as app;
use libs\vecni\Session as session;
use controller\user\User;
use controller\property;
b4oshany /
Last active Aug 29, 2015
BootstrapValidator Library of Objects.....
Lets Call the js below bv.libs.js file.
var bv = {
message: {
notEmpty: 'This field is required and can\'t be empty.'
enable_only: {
enabled: {
b4oshany / Makefile
Last active Aug 29, 2015
GAE-INIT installer
View Makefile
APPENGINE_PATH = /usr/local/google_appengine
APPENGINE_APPCFG = /usr/local/google_appengine/
APP_PATH = $(shell pwd)
USER = $(shell whoami)
USER_HOME = /home/${USER}
python -f
View Calendar.php
namespace libs\schedule;
require_once "setup.php";
use libs\vecni\Vecni;
use libs\mongodb\Model;
use libs\user\User;
use libs\location\Location;
use libs\schedule\Event;
class Calendar extends Model{
View fullcalendar.js
$(function() {
/* initialize the external events
function ini_events(ele) {
ele.each(function() {
// create an Event Object (
// it doesn't need to have a start or end
var eventObject = {
b4oshany / purechat.js
Last active Aug 29, 2015
Prepopulate PureChat form with the current logged in user.
View purechat.js
// JSON data of your current logged in user.
current_user = {"first_name": "Oshane", "last_name": "Bailey", "email": ""};
var purechat_user_interval = {"obj": undefined, "num_tries": 0};
// Initiate the PureChat plugin onload (async). In addition, set the user
// name and email as soon as PureChat initiation process is completed.
(function () {
var done = false;
var script = document.createElement('script');
b4oshany /
Created Sep 17, 2015
ploneformgen mailer
<html xmlns="">
<p tal:content="here/getBody_pre | nothing" />
<tal:block repeat="field options/wrappedFields | nothing">
<dt tal:content="field/fgField/widget/label" />
<dd tal:content="structure python:field.htmlValue(request)" />
b4oshany /
Created Sep 17, 2015
ploneformgen custom mailer
from Products.CMFCore.utils import getToolByName
mailhost = getToolByName(ploneformgen, 'MailHost')
subject = "Email subject"
# Use this logger to output debug info from this script if needed
import logging
logger = logging.getLogger("mailer-logger")
b4oshany /
Created Sep 28, 2015
Flask mod_wsgi debug mode
import config
from flask import Flask
app = Flask(__name__)
# Jinja2 templates commenting tags
app.jinja_env.line_statement_prefix = '#'
app.jinja_env.line_comment_prefix = '##'
b4oshany /
Created Nov 5, 2015
Install Mongodb on Ubuntu
# Import the public key used by the package management system.
sudo apt-key adv --keyserver hkp:// --recv 7F0CEB10
# Create a list file for MongoDB
echo "deb trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
# Reload local package database.
sudo apt-get update
# Install the MongoDB packages.