This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import the public key used by the package management system. | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | |
# Create a list file for MongoDB | |
echo "deb http://repo.mongodb.org/apt/ubuntu 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Ashraf M Kaabi | |
* @name Advance Linux Exec | |
*/ | |
class Process { | |
/** | |
* Run Application in background | |
* | |
* @param unknown_type $Command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime, timedelta, date | |
dates = [] | |
today = datetime.today() | |
years = ["25/12/%d" % x for x in xrange(today.year, today.year + 101) if date(x, 12, 25).weekday() == 3] | |
print years |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ignore files | |
*.pyc | |
*.pyo | |
*.db | |
*.log | |
*.swp | |
*.swo | |
*~ | |
*.orig | |
*.eggs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install postgress server locally | |
sudo apt-get install postgresql postgresql-contrib | |
# Install PostGIS, procedural languages, client interfaces, etc | |
sudo apt-cache search postgres | |
# Install PGAdmin or Postgres UI, which is similar to PHPMyAdmin. | |
sudo apt-get install pgadmin3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def binary_search(lst, comparator): | |
"""Perform a binary search of the given list based on the given comparator | |
Arguments: | |
lst (list): | |
List of items to search through. | |
comparator (function): | |
Reference pointer for the function or method. This function should | |
only accept one parameter which is a signle list item. In addition, | |
this function should return a boolean value or none. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function base_installer { | |
# Install virtualenv | |
if [ -z $(which virtualenv) ]; then \ | |
sudo apt-get install python-virtualenv; \ | |
fi | |
# Create virtualenv for project | |
if [ ! -e "bin/pip" ]; then \ | |
virtualenv . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//new chart type LineBar - its a bit like bar and line were slammed together at high speed, not pretty, but they are part of each other now | |
(function(){ | |
"use strict"; | |
var root = this, | |
Chart = root.Chart, | |
helpers = Chart.helpers; | |
var defaultConfig = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
APPENGINE_PATH=/usr/local/google_appengine | |
APPENGINE_APPCFG=/usr/local/google_appengine/appcfg.py | |
APP_PATH=$(pwd) | |
USER=$(whoami) | |
USER_HOME=/home/${USER} | |
APPENGINE_DLOAD=${USER_HOME}/google_appengine_1.9.37.zip | |
if [ -z $(which curl) ]; then \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################ | |
# Poor men's Plone export | |
# (C) 2013, ZOPYX Ltd, D-72074 Tuebingen | |
################################################################ | |
import os | |
import shutil | |
import tempfile | |
import glob | |
import transaction |