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
<? if(cliprz::system(config)->get('language','direction') == 'rtl'): ?> | |
<link rel="stylesheet" type="text/css" href="<?=assets('bootstrap/css/bootstrap.rtl.css')?>" /> | |
<link rel="stylesheet" type="text/css" href="<?=assets('bootstrap/css/bootstrap-responsive-rtl.css')?>"> | |
<? else: ?> | |
<link rel="stylesheet" type="text/css" href="<?=assets('bootstrap/css/bootstrap.css')?>" /> | |
<link rel="stylesheet" type="text/css" href="<?=assets('bootstrap/css/bootstrap-responsive.css')?>"> |
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 | |
function count_words($needed_word, $string) | |
{ | |
$words = str_word_count($string, 1); | |
$words_count = array_count_values($words); | |
// Use multibyte string to lower | |
return $words_count[mb_strtolower($needed_word)]; | |
} |
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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Istighfar</title> | |
<style type="text/css"> | |
.cases{ | |
overflow: visible; | |
} | |
.cases .case{ |
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
# -*- coding: utf8 -*- | |
from django import forms | |
from cars import models | |
from django.contrib.humanize.templatetags.humanize import intcomma | |
# Insert an empty value which represent ANY choice | |
for attr in dir(models): | |
if attr.endswith('_CHOICES'): | |
CHOICES = list(getattr(models, attr)) | |
CHOICES.insert(0, ('', 'Any')) |
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
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(\w+)\.php\?id=([0-9]+)$ page-router.php?name=$1&id=$2 [QSA,L] | |
</IfModule> |
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 | |
from time import strftime, strptime, mktime | |
file_name = 'names.lst' | |
trash_file_name = 'old_names.lst' | |
filter_date = strftime('%d-%m-%Y') #'01-01-2012' | |
def timestamp(strtime, format = '%d-%m-%Y'): | |
return mktime(strptime(strtime, format)) |
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
Options -Indexes | |
Options +FollowSymLinks | |
# Set the default file for indexes | |
DirectoryIndex index.php | |
<IfModule mod_rewrite.c> | |
# mod_rewrite rules | |
RewriteEngine on |
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
/* page.php?xxxx */ | |
$next = $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']; | |
session_start(); | |
$_SESSION['next'] = $next; | |
printf('<a href="login.php">login</a>', $next); | |
/* login.php */ | |
session_start(); | |
$next = $_SESSION['next']; | |
/* ... */ |
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
/* page.php?xxxx */ | |
$next = $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']; | |
printf('<a href="login.php?next=%s">login</a>', $next); | |
/* login.php */ | |
$next = $_GET['next']; | |
/* ... */ | |
// حول المتسخدم الى الرابط الذي جاء منه |
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
<form action="<?=$_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data"> | |
<? | |
$num_files = 5; | |
while($num_files){ | |
echo '<input type="file" name="file[]" /> <br>'; | |
$num_files --; | |
} | |
?> | |
<input type="submit" name="upload" /> |