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
convert *.JPG -resize "600^>" -gravity center -crop 600x600+0+0 -strip -set filename:area "%t" '%[filename:area]-thumb.JPG'
@creimers
creimers / apollo-angular1-query.js
Created March 7, 2017 14:35
a basic example of how to use an apollo query with variables and angular 1
queryJobs() {
const jobQuery = gql`
query($city: String) {
jobs(city: $city){
id
title
teaser
imageSmall
published
}

Keybase proof

I hereby claim:

  • I am creimers on github.
  • I am creimers (https://keybase.io/creimers) on keybase.
  • I have a public key ASCSLxFxDoHughnws28kEUBu6qzUYHz6in3xXeQKJsvRmgo

To claim this, I am signing this object:

@creimers
creimers / lazy.js
Created December 9, 2016 13:11
Lazy loading with angular1 component router and webpack code split
class lazyAppCtrl {
constructor($q, $rootRouter, $ocLazyLoad) {
this.$q = $q
this.$rootRouter = $rootRouter
this.$ocLazyLoad = $ocLazyLoad
this.$rootRouter.config([
{
path: '/lazy',
name: 'Lazy',
RelatedObjectDoesNotExist: Page has no publisher_draft.
from cms.models import Page
pages = Page.objects.all()
ids = [page.id for page in pages if page.get_absolute_url()=='/mitmachen/das-kannst-du-tun/']
one = ids[0]
two = ids[1]
one.publisher_public = two
agrs `ag -l search_string`
:argdo %s/cmd/command/ge | update
pip install -e 'git+https://github.com/creimers/cmsplugin_seocheck.git#egg=cmsplugin_seocheck'
@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()
}
@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/
@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