Skip to content

Instantly share code, notes, and snippets.

View firdoussross's full-sized avatar

Firdouss Ross firdoussross

View GitHub Profile
@stefanfoulis
stefanfoulis / osx_developer_installation.rst
Last active July 10, 2024 14:36
Instructions on how to setup an OSX developer machine for (python/django) development

OSX Developer System installation

This guide assumes a fresh install of Mac OSX 10.7 Lion.

Brew User

@aliang
aliang / Mac SSH Autocomplete
Created June 14, 2011 07:14
Add auto complete to your ssh, put into your .bash_profile
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
@jpustula
jpustula / gist:1136739
Created August 10, 2011 12:57
Count unread post for phpBB 3.0.9 (file includes/functions.php)
// Count posts since last vivist
if ($user->data['is_registered'] && $config['load_search'] && $auth->acl_get('u_search') && $auth->acl_getf_global('f_search'))
{
/*$ex_fid_ary = array_unique(array_merge(array_keys($auth->acl_getf('!f_read', true)), array_keys($auth->acl_getf('!f_search', true))));
if ($auth->acl_get('m_approve'))
{
$m_approve_fid_ary = array(-1);
$m_approve_fid_sql = '';
}
@peteboere
peteboere / jquery.alterclass.js
Created December 24, 2011 12:49
jQuery alterClass plugin: Remove element classes with wildcard matching. Optionally add classes.
/**
* jQuery alterClass plugin
*
* Remove element classes with wildcard matching. Optionally add classes:
* $( '#foo' ).alterClass( 'foo-* bar-*', 'foobar' )
*
* Copyright (c) 2011 Pete Boere (the-echoplex.net)
* Free under terms of the MIT license: http://www.opensource.org/licenses/mit-license.php
*
*/
@panuta
panuta / gist:1852087
Last active June 16, 2024 18:15
How to setup Django/Postgresql on OS X Mountain Lion using Homebrew

Command Line Tools for Xcode

Command line tools comes bundle with Xcode prior to 4.3 version. After 4.3, you need to install a separated command line tools yourself.

First, go to this url and login using Apple Developer account (Free to register)

https://developer.apple.com/downloads/index.action
@renyi
renyi / requirements.txt
Created April 15, 2012 12:25
webplus requirements
# pip install -r requirements.txt
python-memcached
psycopg2
gunicorn
greenlet
gevent
pillow
reportlab
@smeranda
smeranda / facebook_like-box_responsive.css
Created May 1, 2012 20:37
Flexible width layout for Facebook Like Box/Activity Stream to use in Responsive Designs
/*
Make the Facebook Like box responsive (fluid width)
https://developers.facebook.com/docs/reference/plugins/like-box/
*/
/* This element holds injected scripts inside iframes that in some cases may stretch layouts. So, we're just hiding it. */
#fb-root {
display: none;
}
@bgallagh3r
bgallagh3r / wp.sh
Last active March 24, 2024 03:12
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
@renyi
renyi / admin.py
Created September 2, 2012 09:37
Mezzanine Translatable
from django.contrib import admin
from mezzanine.conf import settings
from mezzanine.core.admin import TabularDynamicInlineAdmin
if "mezzanine.pages" in settings.INSTALLED_APPS:
from mezzanine.pages.models import RichTextPage, Link
from mezzanine.pages.admin import PageAdmin, LinkAdmin
from models import TransRichTextPage, TransLinkPage
#
@renyi
renyi / local_settings.py
Last active October 11, 2015 00:47
local_settings.py
DEBUG = True
TEMPLATE_DEBUG = True
COMPRESS_ENABLED = True
TEMPLATE_USE_CDN = False
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "dev.db"
}