Skip to content

Instantly share code, notes, and snippets.

View anova's full-sized avatar

Necat Bolpaça anova

View GitHub Profile
@ramiabraham
ramiabraham / web.config
Created September 18, 2015 00:08
IIS web.config 301 and 302 redirect examples
<?xml version="1.0"?>
<configuration>
<system.webServer>
<httpRedirect enabled="true" destination="http://foo.com/newdir" httpResponseStatus="Permanent" />
</system.webServer>
</configuration>
<?xml version="1.0"?>
<configuration>
<system.webServer>
@Toddses
Toddses / iis-web.config
Last active July 14, 2023 04:29
Example web.config for WordPress on IIS
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.php" />
</files>
</defaultDocument>
<rewrite>
@jlengstorf
jlengstorf / README.md
Created October 8, 2014 20:28
Adds responsive embedding to WordPress oEmbed content.

Responsive Embeds in WordPress

This snippet filters oEmbed output in WordPress (the_content()) to force responsive embeds.

Usage

To use, add the contents of responseive_embeds.less to your site's stylesheet (if you're not using LESS, don't forget to move the iframe,object,embed rule outside of .embed-container and change it to .embed-container iframe,.embed-container object,.embed-container embed).

Then add the responsive_embed() function to your theme's functions.php and insert the add_filter() call in your theme's setup function.

@contensis
contensis / mime_type_configuration.xml
Last active October 1, 2020 08:29
How to configure MIME types within web.config.
<?xml version="1.0"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".vtt" mimeType="text/vtt" />
<mimeMap fileExtension=".srt" mimeType="text/srt" />
<mimeMap fileExtension=".aac" mimeType="audio/aac" />
<mimeMap fileExtension=".oga" mimeType="audio/ogg" />
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<mimeMap fileExtension=".webm" mimeType="video/webm" />
@UnderlineWords
UnderlineWords / UlkeListesi.php
Last active December 26, 2019 00:18
Türkçe Ülke Listesi
<?php
/**
Türkçe Ülke Listesi
*/
$countries = [
'TR' => 'Türkiye',
'VI' => 'ABD Virgin Adaları',
'AF' => 'Afganistan',
'AX' => 'Aland Adaları',
'DE' => 'Almanya',
@ugurozpinar
ugurozpinar / turkce_siralama.js
Created March 21, 2014 09:36
Javascript object array Turkish sorting. Türkçe Sıralama
var arr = [{id:3,title:"Ali"},{id:3,title:"Veli"},{id:3,title:"Vehbi"}];
arr.sort(turkcesiralama);
function turkcesiralama(a, b){
var atitle = a.title;
var btitle = b.title;
var alfabe = "AaBbCcÇçDdEeFfGgĞğHhIıİiJjKkLlMmNnOoÖöPpQqRrSsŞşTtUuÜüVvWwXxYyZz0123456789";
if (atitle.length === 0 || btitle.length === 0) {
return atitle.length - btitle.length;
}
@firepol
firepol / bootstrap_ms.css
Last active September 23, 2020 19:14 — forked from andyl/bootstrap_ms.css
updated max-width: 767px to avoid breaking the existing behavior on col-sm
.col-ms-1,
.col-ms-2,
.col-ms-3,
.col-ms-4,
.col-ms-5,
.col-ms-6,
.col-ms-7,
.col-ms-8,
.col-ms-9,
.col-ms-10,
/*
* jQuery Double Tap
* Developer: Sergey Margaritov (github.com/attenzione)
* License: MIT
* Date: 22.10.2013
* Based on jquery documentation http://learn.jquery.com/events/event-extensions/
*/
(function($){
@mustafauysal
mustafauysal / br.php
Created September 13, 2013 14:08
please don't break me!
<?php
add_filter('the_content', 'remove_br_tags');
function remove_br_tags($content) {
return preg_replace('/<br(\s+)?\/?>/i', "\n", $content);
}
@metude
metude / gist:4347001
Created December 20, 2012 17:31
Simple Font Detect with JS (source: http://my.opera.com/QuHno/ )
/*********************** Fontdetect - The font stuff - START ********************/
var font = document.getElementById('font'); // The hidden input field
var output = document.getElementById('output'); // the detected font results go here
var fontList =''; // the result
var computed = window.getComputedStyle(output, null); // the actual style of the tested element