Skip to content

Instantly share code, notes, and snippets.

View creimers's full-sized avatar
🏠
Working from a great place

C Reimers creimers

🏠
Working from a great place
View GitHub Profile
@creimers
creimers / gist:ee8aad04529568d305c6
Created January 9, 2015 00:25
django(cms) ckeditor_settings
CKEDITOR_SETTINGS = {
'language': '{{ de }}',
'toolbar_CMS': [
['Undo', 'Redo'],
['cmsplugins', '-', 'ShowBlocks'],
['Format', 'Styles'],
'/',
[ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl', 'Language' ],
[ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', ],
[ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ],
@creimers
creimers / gist:db59eec8dbdf132eda95
Created February 14, 2015 19:28
ionic deploy andorid
cordova build --release android
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore HelloWorld-release-unsigned.apk alias_name
/Users/christoph/Library/Android/sdk/build-tools/21.1.2/zipalign -v 4 platforms/android/ant-build/CordovaApp-release-unsigned.apk HPS-Teeküche.apk
import os
from django.core.handlers.wsgi import WSGIHandler
import django
class WSGIEnvironment(WSGIHandler):
def __call__(self, environ, start_response):
os.environ['DATABASE_URL'] = environ['DATABASE_URL']
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_app.settings")
@creimers
creimers / .vimrc
Last active August 29, 2015 14:18
minimal .vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
@creimers
creimers / .bashrc
Last active August 29, 2015 14:18
minimal bashrc
alias ll='ls -la'
export VISUAL=vim
export EDITOR="$VISUAL"
@creimers
creimers / bootstrap.sh
Last active August 29, 2015 14:18
Server bootstrap
# Root no ssh
echo "PermitRootLogin no" > /etc/ssh/sshd_config
# add user to sudo
sudo adduser <username> sudo
# ssh key
mkdir .ssh
ssh-keygen
@creimers
creimers / gist:04143c1b2e7f7dec5033
Created April 15, 2015 11:00
django database from venv
if 'DATABASE_URL' not in os.environ:
os.environ['DATABASE_URL'] = 'sqlite:///'+ BASE_DIR + '/project.db'
import dj_database_url
DATABASES = {
'default':
dj_database_url.config()
}
pip install -e 'git+https://github.com/creimers/cmsplugin_seocheck.git#egg=cmsplugin_seocheck'
@creimers
creimers / gist:a43b41b73815471a5e64
Last active October 6, 2015 09:09
create postgresql database
sudo su - postgres
createdb mydb
createuser -P
psql
GRANT ALL PRIVILEGES ON DATABASE mydb TO myuser;
\q
su - appUser
postgres://username:password@localhost:5432/mydb
mysql://username:password@localhost:3306/mydb
@creimers
creimers / gist:fac8cff8072180246d2d
Last active October 6, 2015 09:17
apache django config
SetEnv DATABASE_URL mysql://db:db@localhost:3306/db
WSGIDaemonProcess djangocms python-path=/var/www/vhosts/project_folder/project:/var/www/vhosts/project_folder/project/env/lib/python3.4/site-packages
WSGIProcessGroup djangocms
WSGIScriptAlias / /var/www/vhosts/project_folder/project/marktzeit/wsgi.py
Alias /media/ /var/www/vhosts/project_folder/project/media/
Alias /static/ /var/www/vhosts/project_folder/project/static/