Skip to content

Instantly share code, notes, and snippets.

View valeriu's full-sized avatar
🎯
Focusing

Valeriu Tihai valeriu

🎯
Focusing
View GitHub Profile
@valeriu
valeriu / ex-finale.html
Last active December 12, 2015 22:09
Kasyan, Flora - Epreuve finale
<html>
<head>
<!-- Nom de l'étudiant : Kasyan, Flora -->
<title>&Eacute;preuve finale - Olympiades</title>
<script language="JavaScript" type="text/javascript">
function afficherMessages () {
// declaration des variables;
@valeriu
valeriu / nav-wp-add-css-class-to-body.html
Created February 19, 2013 04:14
Add css class to body if exist specific class.
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<style type="text/css">
.important {background-color: #f3f3f3;}
.nui {background-color: red;}
</style>
</head>
<body class="aiciDejaExistaClasa">
@valeriu
valeriu / lastIndexOf.html
Last active December 14, 2015 21:39
Reports the zero-based index position of the last occurrence of a specified Unicode character or string within this instance. The method returns -1 if the character or string is not found in this instance.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>lastIndexOf</title>
</head>
<body>
<script type="text/javascript">
var str = "abcdefabcdef"
@valeriu
valeriu / caractere.html
Created April 9, 2013 00:37
The [patern]{x} quantifier matches any string that contains a sequence of x paterns.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Chiffre</title>
</head>
<body>
<script type="text/javascript">
var chiffre = /^([0-9]{3})*$/;
@valeriu
valeriu / ruemtl.js
Created April 11, 2013 03:02
Rue du Montreal
var rueMTL = ["rue A.-A.-Desroches", "rue d'Abancourt", "rue Abbott", "rue Abélard", "rue de l'Abord-à-Plouffe", "rue Abrams", "rue Acadia", "rue de l'Acadie", "rue de l'Acajou", "rue de l'Achillée", "rue Achille-Fortier", "rue Achim", "rue Acorn", "rue Acorn", "rue Acres", "rue Adam", "rue Addington", "rue Addison", "rue Adrien-Hébert", "rue Adrienne", "rue Aegidius-Fauteux", "rue Aéterna", "rue Agnès", "rue de l'Aiguillage", "rue Aimé-Geoffrion", "rue Aimé-Lecavalier", "rue Aimé-Renaud", "rue Airlie", "rue Alain", "rue Alain-Grandbois", "rue Albanel", "rue Albéric-Gélinas", "rue Albert", "rue Albert-Chamberland", "rue Albert-Couture", "rue Albert-Einstein", "rue Albert-Ferland", "rue Albertine-Morin", "rue Albert-Laberge", "rue Albert-Lacombe", "rue Albert-Lozeau", "rue Albert-Malouin", "rue Aldéric-Beaulac", "rue Aldis-Bernard", "rue Alexander", "rue Alexander-C.-Hutchison", "rue Alexander-Fleming", "rue Alexandra", "rue Alexandre-Carli", "rue Alexandre-DeSève", "rue Alexandre-Lacoste", "rue Alfred", "rue
@valeriu
valeriu / backup.sh
Created August 17, 2013 02:58
Backup incrémentales
WEEK=$(date +%V)
BKDIR="/var/www/cron/backup/$WEEK"
BKSITE="/var/www/site"
BKDEL="/var/www/cron/backup/*"
if [ ! -d "$BKDIR" ]; then
mkdir -p $BKDIR
tar -czf $BKDIR/bk-full.tar.gz -g $BKDIR/bk_infos.txt $BKSITE
fi
@valeriu
valeriu / gist:8507116
Created January 19, 2014 16:24
Inlaturam fisierul css din plugin
add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
function my_deregister_styles() {
wp_deregister_style( 'wp-pagenavi' );
}
.btn-new-color {
background-image: linear-gradient(#DCA, #DDB);
border-color: #B5A0A0;
color: #4C3D3D !important;
&:hover {
background-color: #DDD8B6;
}
}
@valeriu
valeriu / user-agent.php
Created July 30, 2014 16:50
add user-agent to <body> for wordpress projects
<?php
// author : Clervens Volcy - http://goo.gl/G1hRPS
// add conditional statements for mobile devices
function is_ipad() {
$is_ipad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPad');
if ($is_ipad)
return true;
else return false;
@valeriu
valeriu / wp-htaccess.sh
Created July 6, 2017 00:58
http to https
# Redirect http to https .htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{ENV:HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
# Redirect http to https apache
<VirtualHost *:80>
ServerName www.example.com