This file contains hidden or 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
| <%= simple_form_for(@category) do |f| %> | |
| <%= f.error_notification %> | |
| <div class="form-inputs"> | |
| <%= f.input :name %> | |
| <%= f.input :description %> | |
| <%= f.input :parent_id %> | |
| </div> | |
| <div class="form-actions"> |
This file contains hidden or 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
| NoMethodError in Categories#index | |
| Showing /home/mon_beau_path_vers_mon_app/web/annuaire/app/views/categories/index.html.erb where line #17 raised: | |
| undefined method `parent' for #<Category:0x0000000454e6e8> | |
| Extracted source (around line #17): | |
| 14: <tr> | |
| 15: <td><%= category.name %></td> |
This file contains hidden or 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 | |
| /** | |
| * Display thumbs generate by Wordpress' service Mshot and write | |
| * locally the thumb after generation to have better loading web performance. | |
| * | |
| * Thx @jd_ma for help :) | |
| */ | |
| function show_and_write_thumbnail ($url, $width=200, $height=150) { |
This file contains hidden or 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/sh | |
| # optiJPG.sh: a sample shell script to launch JPG optimisation | |
| # via: find ./ -type f -name '*.jpg' -exec ./optiJPG.sh {} \; | |
| # TODO define usage function | |
| for f; do | |
| jpegtran -copy none -optimize -perfect -outfile $f $f | |
| echo $f OK.. | |
| done |
This file contains hidden or 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 | |
| // http://clients1.google.com/complete/search?hl=fr&output=toolbar&q=gestion%20des%20logs | |
| $q = $argv[1]; | |
| $url = "http://clients1.google.com/complete/search?hl=fr&output=toolbar&q=".urlencode($q); | |
| /* gets the data from a URL */ | |
| function get_data($url) { | |
| $ch = curl_init(); |
This file contains hidden or 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 | |
| // http://clients1.google.com/complete/search?hl=fr&output=toolbar&q=gestion%20des%20logs | |
| $query = urlencode($_GET['q']); | |
| $uri = "http://clients1.google.com/complete/search?hl=fr&output=toolbar&q=".$query; | |
| /* gets the data from a URL */ | |
| function get_data($url) { | |
| $ch = curl_init(); |
This file contains hidden or 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
| # forms.py | |
| from django import forms | |
| from django.contrib.auth.models import User | |
| class ConnexionForm(forms.Form): | |
| username = forms.CharField(label="Nom d'utilisateur", max_length=30) | |
| password = forms.CharField(label="Mot de passe", widget=forms.PasswordInput) | |
This file contains hidden or 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 ajout(request): | |
| if request.method == "POST": | |
| lien_form = LienForm(request.POST) | |
| ancre_form = AncreForm(request.POST) | |
| if lien_form.is_valid(): | |
| lien = Lien() | |
| lien.date = lien_form.cleaned_data['date'] | |
| lien.url = lien_form.cleaned_data['url'] | |
| lien.page = lien_form.cleaned_data['page'] | |
| lien.typeLien = lien_form.cleaned_data['typeLien'] |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| set1 = open('set1.txt','r') | |
| set2 = open('set2.txt','r') | |
| output = open('diff.txt','w') | |
| eachhost1 = set1.read().splitlines() | |
| #print eachhost1 | |
| eachhost2 = set2.read().splitlines() |
This file contains hidden or 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 django.db import models | |
| from django.contrib.auth.models import User | |
| # Create your models here. | |
| class Site(models.Model): | |
| user = models.ForeignKey(User) | |
| site = models.CharField(max_length=255) | |
| def __unicode__(self): | |
| return self.site |
OlderNewer