View open-frame-after-closing-first.cs
This file contains 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
private void OnButton1Click(object sender, EventArgs e) | |
{ | |
this.Hide(); //On cache la fenêtre courante | |
var form2 = new Form2(); //On instancie la seconde | |
form2.Closed += (s, args) => this.Close(); //On notifie à la première de se fermer au moment où la seconde se ferme | |
form2.Show(); //On affiche la seconde | |
} |
View .htaccess
This file contains 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
# webroot/.htaccess | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteRule ^$ webroot/ [L] | |
RewriteRule (.*) webroot/$1 [L] | |
</IfModule> |
View .htaccess
This file contains 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
# .htaccess | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] | |
</IfModule> |
View wrong-way-to-include-excerpt
This file contains 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.content | truncate(500)}} </br> <a href="{{ post.url }}">Lire plus ... </a> |
View correct-way-to-include-excerpt-in-gh-pages
This file contains 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
{{ post.content| split: '<!--more-->' | first }} <br/><a href="{{ post.url }}">Lire plus ...</a> |
View disable-constraint-sql-server.sql
This file contains 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
USE <nom_database> ; | |
EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"; |
View enable-constraint-sql-server.sql
This file contains 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
USE <nom_database>; | |
Exec sp_msforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"; |
View sending-mail-in-PHP-with-mail-function.php
This file contains 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 if(isset($_POST['submit'])){ | |
if(isset($_POST['email']) && !empty($_POST['email']) && isset($_POST['name']) && !empty($_POST['name']) && isset($_POST['subject']) && !empty($_POST['subject']) && isset($_POST['message']) && !empty($_POST['message'])){ | |
$to = "contact@micronium.net"; | |
$subject = $_POST['subject']; | |
$message = $_POST['message']; | |
//$header = "Name= " . | |
$header = "From:" . $_POST['name'] . " <" . $_POST['email'] . "> \r\n"; | |
$header .= "MIME-Version: 1.0\r\n"; | |
$header .= "Content-type: text/html\r\n"; | |
$header .= "X-Mailer: PHP/" . phpversion(); |
View drop-constraint-and-create-again-sql-server.sql
This file contains 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
CREATE TABLE #x -- feel free to use a permanent table | |
( | |
drop_script NVARCHAR(MAX), | |
create_script NVARCHAR(MAX) | |
); | |
DECLARE @drop NVARCHAR(MAX) = N'', | |
@create NVARCHAR(MAX) = N''; | |
-- drop is easy, just build a simple concatenated list from sys.foreign_keys: | |
SELECT @drop += N' | |
ALTER TABLE ' + QUOTENAME(cs.name) + '.' + QUOTENAME(ct.name) |
OlderNewer