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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script async="async" src="https://www.googletagservices.com/tag/js/gpt.js"></script> | |
<script async src="//acdn.adnxs.com/prebid/not-for-prod/1/prebid.js"></script> | |
<script> | |
var googletag = googletag || {}; | |
googletag.cmd = googletag.cmd || []; | |
var pbjs = pbjs || {}; |
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
#!/Users/username/Documents/python/projectname/env/bin/python | |
# change username and projectname above to match yours - the path must match the path in YOUR virtualenv | |
""" | |
edit line 1 to match what YOU get when you are in YOUR virtualenv and type: | |
which python | |
# NO SPACES in first 3 chars in line 1: #!/ | |
# make sure env is activated! |
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 | |
$today = date("Y-m-d"); | |
$month = date("Y-m"); $mpattern = '/^'.$month.'/'; | |
$yesterday = date('Y-m-d', strtotime("1 day ago" )); | |
foreach ($metrics_global as $k => $row) { | |
// DEBUG echo $k."-(".$row['met_date']." / ".$row['earn'].")<br />"; | |
$total+= $row['earn']; | |
if (in_array($yesterday, $row)) {$hier = $row['earn'];} |
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 |
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
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
# 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
<?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
<?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
#!/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 |
NewerOlder