Skip to content

Instantly share code, notes, and snippets.

View matinfo's full-sized avatar

Mathieu Meylan matinfo

  • Switzerland
View GitHub Profile
@matinfo
matinfo / 1_virtualenv_gems_install.env
Last active August 29, 2015 14:02
Virtualenv Ruby install gems script from requirement_gems.txt
# add first to your virtualenv (postactivate or autoenv, etc)
export GEM_HOME="$VIRTUAL_ENV/gems"
export GEM_PATH=""
export PATH=$PATH:"$GEM_HOME/bin"
@davidbgk
davidbgk / current_page_middleware.py
Created April 28, 2010 16:20
Django: Current Page Middleware
"""
Current Page Middleware.
This module provides a middleware that implements a mechanism to
highlight a link pointing to the current URL.
Thanks @davidbgk and @samueladam for improvements & optimizations
"""
import re
jq('div').live('pagebeforeshow', function(event, ui){
var page = jq(event.target);
var url = page.attr('data-refresh');
if(url){
var ajax = {};
ajax.url = url;
ajax.type = 'GET';
@FinalAngel
FinalAngel / osx_developer_installation.rst
Created August 16, 2012 11:22 — forked from stefanfoulis/osx_developer_installation.rst
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.8 Mountain Lion.

Requirements

  1. Install XCode
@matinfo
matinfo / gist:96747456aab36ea34c2681433a2f594c
Created October 15, 2016 15:09
Handel max char left control for input and textarea with angularJS directive
// Handel max char left control for input and textarea
/* Set on your project this minumum css style (adapt for your need)
* mandatory for directive *maxlength-control*
*/
/*
.maxlength-control ~ .maxlength-control-status {
color: #b5b5b5;
float: right;
@matinfo
matinfo / App.vue
Last active July 20, 2018 13:55
RedactorEditor.vue
import Vue from 'vue'
import VeeValidate from 'vee-validate'
...
import RedactorEditor from './components/RedactorEditor.vue'
Vue.use(VeeValidate)
@Valian
Valian / example_forms.py
Last active February 8, 2021 14:32
Django MultipleFormMixin for displaying dynamic number of forms on the same page. Compatible with the standard FormMixin.
class ContactForm(forms.Form):
name = forms.CharField(max_length=60)
message = forms.CharField(max_length=200, widget=forms.TextInput)
class SubscriptionForm(forms.Form):
email = forms.EmailField()
want_spam = forms.BooleanField(required=False)
@nguyentamvinhlong
nguyentamvinhlong / rabbitmq-server-change-hostname.md
Last active July 8, 2021 16:49
rabbitmq-server change hostname

rabbitmq-server change hostname

Remove the old installation of RabbitMQ to fix this problem. Here are steps to reinstall RabbitMQ. These commands are run as the root user:

Stop RabbitMQ:

rabbitmqctl stop

Change

@bmispelon
bmispelon / placeholderify.py
Created April 27, 2015 22:03
Automatic placeholder attributes from field labels in Django forms
from functools import partial
def placeholderify(form=None, fields=None):
"""
A decorator for Django forms that sets a `placeholder` attribute to all
fields. Each field's label is used as a placeholder.
Use it like so:
@mlouro
mlouro / gulpfile.js
Last active June 21, 2022 23:20
gulpfile.js with browserify, jshint, libsass, browserSync for livereload, image optimization and system notifications on errors
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');